vvysotskyi commented on pull request #2120:
URL: https://github.com/apache/drill/pull/2120#issuecomment-766965951


   @cgivre, looks like I've found the reason why the limit cannot be applied 
for the case you have pointed.
   Drill uses the `DrillPushLimitToScanRule` rule to push the limit to scan. 
This rule can be applied at the **logical** planning phase.
   Mongo storage plugin uses the `MongoPushDownFilterForScan` rule to push 
filter to scan. This rule is applied at the **physical** planning phase (in its 
constructor it passes `FilterPrel`and `ScanPrel` rel nodes to match).
   
   The solution for this issue is quite simple - update 
`MongoPushDownFilterForScan` to be able to work apply at any phase, for it, 
please replace  `FilterPrel` with `org.apache.calcite.rel.core.Filter` and 
`ScanPrel` with `DrillScanRelBase`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to