MaxGekk commented on PR #59985: URL: https://github.com/apache/spark/pull/59985#issuecomment-6727535581
Thank you for the thorough review, @dongjoon-hyun, and sorry for the slow reply. I reworked the PR in 94228e373fa along the lines of your two questions: - **Opt-in until SPARK-60872.** The legacy config is replaced by `spark.sql.optimizer.evaluateNotNullChecksInOrder`, default `false`. With it off, the optimizer and the filter codegen behave as on master, so the migration note is gone. The decode cost you pointed at, 0.88 -> 2.54 on the `y * 3` shape, is real for any conjunct that can raise. Narrowing the conjuncts would not remove it there, so I'd turn the config on by default together with SPARK-60872, which tests only the null bit. - **Position-based placement instead of the tag.** `INFERRED` and `markInferred` are gone. With the config, `InferFiltersFromConstraints` places an inferred predicate just before the first conjunct that references its columns. The codegen then generates every check that cannot raise at its position before a conjunct that can, with no written/inferred distinction. Explain shows the position, and the tag's race and its invisibility to canonicalization are gone with it. `y + 1 > 0 AND x > 0` now raises with codegen on and off alike. The predicates inferred for the sides of a join still go to a filter of their own, which the codegen treats like any other check, by position. The rest of the review is in the same commit: - the classification is computed once per operator; - the NULL-conjunct decisions keep their master classification; - the list of non-raising functions is gone in favor of `ExprUtils.canEvaluateUnconditionally`, which SPARK-60882 extended on master; - the code uses `AliasHelper`; - `precedingNotNullChecks` returns `Seq[Expression]` again. The tests are rewritten so that removing each case of the walk fails one of them. Details are in the threads and the updated description. -- 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]
