Skip to content

Conversation

@cxzl25
Copy link
Contributor

@cxzl25 cxzl25 commented Dec 23, 2025

Which issue does this PR close?

Closes #1763

Rationale for this change

Datafusion's BinaryExpr needs to meet a certain ratio before it can perform short-circuit calculation. There is an optimization in Auron that can perform short-circuit calculation.

https://github.com/apache/datafusion/blob/33ac70dd6d634da040cc34abd414425b176a2b99/datafusion/physical-expr/src/expressions/binary.rs#L641-L644

/// Based on the results calculated from the left side of the short-circuit operation,
/// if the proportion of `true` is less than 0.2 and the current operation is an `and`,
/// the `RecordBatch` will be filtered in advance.
const PRE_SELECTION_THRESHOLD: f32 = 0.2;

What changes are included in this PR?

Are there any user-facing changes?

Added the configuration spark.auron.forceShortCircuitAndOr

The default is false. When setting true, the short-circuit operation is forced.

How was this patch tested?

local test

@github-actions github-actions bot added the spark label Dec 23, 2025
Copy link
Member

@wForget wForget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cxzl25 , LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected invocation of UDF

2 participants