You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "ygf11 (via GitHub)" <gi...@apache.org> on 2023/03/01 11:35:05 UTC

[GitHub] [arrow-datafusion] ygf11 commented on pull request #5430: Replace distinct with aggregate for where-in/exists subquery

ygf11 commented on PR #5430:
URL: https://github.com/apache/arrow-datafusion/pull/5430#issuecomment-1449960184

   > I'm not sure whether we should make the rule ReplaceDistinctWithAggregate to handle the where-in/exists subquery specifically. My original thinking was let the rules DecorrelateWhereExists and DecorrelateWhereIn rewrite the subqueries to Joins and in the second pass the rule ReplaceDistinctWithAggregate will rewrite the Distinct to Aggregate since we already run those rules multiple times, so that we can keep a relatively simple ReplaceDistinctWithAggregate rule.
   For those expr subqueries that can not be decorrelated, we can create another optimization task and apply all the existing rules to them
   
   Thanks @mingmwang. One thing I care about If we rewrite distinct in second pass, is that we have to run the rules one more time sometimes, if it is not a problem, it is ok to me. 


-- 
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.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org