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

   > @ygf11 @jackwener 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
   
   Agree with it


-- 
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: [email protected]

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

Reply via email to