Skip to content
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

[SPARK-49695][SQL] Postgres fix xor push-down #48144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrej-db
Copy link
Contributor

What changes were proposed in this pull request?

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.

@github-actions github-actions bot added the SQL label Sep 18, 2024
@urosstan-db
Copy link
Contributor

Can we add some tests?

Copy link
Member

@MaxGekk MaxGekk left a comment

Choose a reason for hiding this comment

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

It would be nice if you add an integration test, for instance here *PostgresExpressionPushdownSuite*

@andrej-db
Copy link
Contributor Author

I wanted to add tests, but didn't know where to put them... Don't know how oss tests postgre.

@urosstan-db
Copy link
Contributor

I wanted to add tests, but didn't know where to put them... Don't know how oss tests postgre.

V2JDBCTest is base class, and there is derived class for Postgres PostgresIntegrationSuite

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-49695] Postgres fix xor push-down [SPARK-49695][SQL] Postgres fix xor push-down Sep 18, 2024
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Thank you, @andrej-db . +1 for adding a test case definitely.

cc @huaxingao , too.

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.

6 participants