-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-49695][SQL][3.5] Postgres fix xor push-down #49071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
MaxGekk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrej-db Please, change PR's title, and replace (3.5 backport) by the tag [3.5]. Also add a link to the original PR to PR's description.
Done. @MaxGekk |
|
Also cc @LuciferYang |
|
@andrej-db The newly added test seems to have failed: |
|
Maybe the tables don't have the same data as in |
|
Thank you @andrej-db |
| } | ||
| } | ||
|
|
||
| override def compileExpression(expr: Expression): Option[String] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to only move this function from https://github.com/apache/spark/pull/48210/files to the branch-3.5? WDYT @MaxGekk and @yaooqinn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#48210 is an improvement rather than a bug fix. If the current pr can solve the issue, this changes is fine to me. Of course, let's hear what others think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's backport only fix related code.
|
also cc @dongjoon-hyun |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM.
### What changes were proposed in this pull request? Backport of the #48144 This PR fixes the pushdown of ^ operator (XOR operator) for Postgres. Those two databases use this as exponent, rather then bitwise xor. Fix is consisted of overriding the SQLExpressionBuilder to replace the '^' character with '#'. ### Why are the changes needed? Result is incorrect. ### Does this PR introduce _any_ user-facing change? Yes. The user will now have a proper translation of the ^ operator. ### How was this patch tested? ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49071 from andrej-db/PGXORBackport. Lead-authored-by: Andrej Gobeljić <[email protected]> Co-authored-by: andrej-gobeljic_data <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
|
Merged to branch-3.5 for Apache Spark 3.5.4. |

What changes were proposed in this pull request?
Backport of the #48144
This PR fixes the pushdown of ^ operator (XOR operator) for Postgres. Those two databases use this as exponent, rather then bitwise xor.
Fix is consisted of overriding the SQLExpressionBuilder to replace the '^' character with '#'.
Why are the changes needed?
Result is incorrect.
Does this PR introduce any user-facing change?
Yes. The user will now have a proper translation of the ^ operator.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
No.