drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dennis Knochenwefel <dennis.knochenwe...@reportix.com>
Subject Implementing inner joins for mongo
Date Thu, 28 Dec 2017 12:48:29 GMT
Hello Drill Dev Pros,

I have found the drill mongo store and would like to extend it to push 
down INNER JOINs. Therefore I would like to rewrite INNER JOINs into the 
mongo aggregation pipeline. Here is a SQL example:

SELECT *
FROM `mymongo.db`.`facts` `facts`
   INNER JOIN `mymongo.db`.`set` `set` ON (`facts`.`group` = `set`.`group`)
WHERE ((`set`.`date` = '09.05.2017') AND (`set`.`id` = '1'))

Could you give me a hint how to do that? I am familiar with the 
aggregation pipeline of mongo, but am not sure how to implement the 
rewrite. I have found the push down of WHERE clauses for mongo [1]

But I am still struggling to do the same for inner joins. If I implement 
"public class MongoPushDownInnerJoinScan extends 
StoragePluginOptimizerRule" then how would the constructor look like. 
Which equivalent of MongoGroupScan (AbstractGroupScan) [2] would I have 
to implement? Any help would be very much appreciated.

Thank you and kind regards,

Dennis


[1] 
https://github.com/apache/drill/blob/master/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoPushDownFilterForScan.java

[2] 
https://github.com/apache/drill/blob/master/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java

-- 
Dennis Knochenwefel
Founder
Reportix
Germany


Mime
View raw message