neilconway commented on PR #22343: URL: https://github.com/apache/datafusion/pull/22343#issuecomment-4481063289
@asolimando Thanks for the feedback! > I agree on the general idea, but considering short-circuiting and also conjuncts' selectivity, this can actually backfire in practice, so a config knob seems important to have (I might have missed it, but I couldn't see it in the PR). It's possible to add a knob if we feel like there is a need for one, but I'd rather not add one reflexively. I partly made the definition of "cheap" vs. "expensive" very conservative in the hopes of avoiding a config knob. Looking more closely at the previous rewriting logic, we actually have not been respecting the predicate order in the query text for a while: `simplify_predicates` already reordered predicates quite freely, and AFAIK no one has complained about that. Users that need to fix an evaluation order should very likely be using `CASE ... WHEN` anyway. > Ideally `reorder_predicates` should be over ridable, to give downstream systems a chance to change behavior if needed, but also to complement knowledge about UDFs which core DF can't know. I think per-UDF extensibility to express some notion of cost or selectivity could definitely make sense, although that's a much bigger task to take on. -- 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]
