rdblue commented on pull request #2017:
URL: https://github.com/apache/iceberg/pull/2017#issuecomment-753391385


   @dilipbiswal, I agree with you and that's why I think that it makes the most 
sense for this to be in the analyzer. We want all of those rewrite rules to be 
applied by the optimizer, rather than trying to do everything in this rule.
   
   The rewrite needs to run before subquery rewrites and optimizations are 
applied, but it currently runs in the operator optimization batch that is after 
OptimizeSubqueries, PullupCorrelatedPredicates, and others. By doing the 
initial rewrite in the analyzer, I think we can delegate more work to the 
optimizer so we can make this rewrite simple and have it optimized later.
   
   I think that the analyzer is a good place to run rewrites that produce a 
concrete logical plan for some action, like delete from. Another example is 
materialized view refresh. Ideally, we would produce a logical plan that then 
gets analyzed and optimized like a query that was written by hand.


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to