spark icon indicating copy to clipboard operation
spark copied to clipboard

[SPARK-48213][SQL] Do not push down predicate if non-cheap expression exceed reused limit

Open zml1206 opened this issue 1 year ago • 0 comments

What changes were proposed in this pull request?

Avoid push down predicate if non-cheap expression exceed reused limit. Push down predicate through project/aggregate need replace expression, if the expression is non-cheap and reused many times, the cost of repeated calculations may be greater than the benefits of pushdown predicates.

Why are the changes needed?

Like #33958, to avoid performance regression caused by repeated evaluation of expensive expressions and larger plans such as case when nested, the difference is that push down will have additional benefits, so add limit of reused count conf instead of 1.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Unit test.

Was this patch authored or co-authored using generative AI tooling?

No.

zml1206 avatar May 09 '24 08:05 zml1206