Skip to content

Conversation

@wForget
Copy link
Member

@wForget wForget commented Apr 16, 2024

Backports #45589 to 3.5

What changes were proposed in this pull request?

Use V2Predicate to wrap If expr when building v2 expressions.

Why are the changes needed?

The PushFoldableIntoBranches optimizer may fold predicate into (if / case) branches and V2ExpressionBuilder wraps If as GeneralScalarExpression, which causes the assertion in PushablePredicate.unapply to fail.

Does this PR introduce any user-facing change?

No

How was this patch tested?

added unit test

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

No

@github-actions github-actions bot added the SQL label Apr 16, 2024
@wForget
Copy link
Member Author

wForget commented Apr 18, 2024

cc @cloud-fan

@cloud-fan
Copy link
Contributor

thanks, merging to 3.5!

cloud-fan pushed a commit that referenced this pull request Apr 18, 2024
…n type of boolean

Backports #45589 to 3.5

### What changes were proposed in this pull request?

Use V2Predicate to wrap If expr when building v2 expressions.

### Why are the changes needed?

The `PushFoldableIntoBranches` optimizer may fold predicate into (if / case) branches and `V2ExpressionBuilder` wraps `If` as `GeneralScalarExpression`, which causes the assertion in `PushablePredicate.unapply` to fail.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

added unit test

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

No

Closes #46074 from wForget/SPARK-47463_3.5.

Authored-by: Zhen Wang <643348094@qq.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@cloud-fan cloud-fan closed this Apr 18, 2024
turboFei pushed a commit to turboFei/spark that referenced this pull request Nov 6, 2025
…n type of boolean (apache#381)

Backports apache#45589 to 3.5

### What changes were proposed in this pull request?

Use V2Predicate to wrap If expr when building v2 expressions.

### Why are the changes needed?

The `PushFoldableIntoBranches` optimizer may fold predicate into (if / case) branches and `V2ExpressionBuilder` wraps `If` as `GeneralScalarExpression`, which causes the assertion in `PushablePredicate.unapply` to fail.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

added unit test

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

No

Closes apache#46074 from wForget/SPARK-47463_3.5.

Authored-by: Zhen Wang <643348094@qq.com>

Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Co-authored-by: Zhen Wang <643348094@qq.com>
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.

2 participants