2010YOUY01 commented on PR #22343:
URL: https://github.com/apache/datafusion/pull/22343#issuecomment-4609736424

   > My broader concern is that it seems pretty fragile to guarantee that 
filter evaluation order matches query text order. I could see this very easily 
being violated by other optimizations, either present or future. For example, 
what about predicate pushdown? If the query has a list of predicates and some 
of them can be pushed down while others cannot, that would result in predicate 
evaluation order becoming inconsistent with the query text order.
   > 
   > So we could _also_ disable predicate pushdown when `reorder_filters` is 
false... but then what about CNF/DNF-style normalization? Offhand I'd expect 
that might also change predicate evaluation order, I'd need to check more 
thoroughly. I'd also expect that when we convert `WHERE`-clause join filters 
into `ON` clauses, we probably don't do that in a way that always respects the 
query text for all classes of predicates (e.g., non-equijoin filters, volatile 
expressions, etc).
   
   This is a great point: over the lifecycle of a filter, multiple optimizer 
passes might mutate it in different ways.
   
   I also think it would be better to make it configurable, but we can do it in 
another PR. Perhaps we could introduce a configuration option to disable this 
whole class of transformations, for users who want hand-tuned behavior. That 
would be better than having one config knob per optimizer rule.


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


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

Reply via email to