@reynlds --
Joining courses and assignments in CD2 should be straightforward (at least it is in my instance). For example:
select courses.id, courses.name, assignments.id, assignments.title
from courses, assignments
where courses.id = assignments.context_id
and assignments.context_type = 'Course'
and assignments.created_at > now() - interval '1 day';
I actually find the data in CD2 to be easier to work with since I don't have to deal with shard IDs and converting between local and global IDs. The IDs I see in CD2 are local IDs and match the IDs that I see via the API and in Canvas itself (e.g. course IDs in URLs).
In any case, if you do need to translate between global IDs (the long ones which include the shard) and local IDs (shorter), here is the logic. You might need to make adjustments for your programming language.
To get a local ID from a global ID:
local_id = global_id % 10000000000000
To get the shard ID from a global ID:
shard_id = int( global_id / 10000000000000 )
To get a global ID from a shard ID and a local ID:
global_id = (shard_id * 10000000000000) + local_id
--Colin