Commit 4248397
[SPARK-49695][SQL] Postgres fix xor push-down
### 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.
Closes #48144 from andrej-db/SPARK-49695-PostgresXOR.
Lead-authored-by: Andrej Gobeljić <[email protected]>
Co-authored-by: andrej-db <[email protected]>
Co-authored-by: andrej-gobeljic_data <[email protected]>
Signed-off-by: Max Gekk <[email protected]>1 parent f1eecd3 commit 4248397
File tree
2 files changed
+14
-0
lines changed- connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2
- sql/core/src/main/scala/org/apache/spark/sql/jdbc
2 files changed
+14
-0
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
246 | 256 | | |
247 | 257 | | |
248 | 258 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
| |||
0 commit comments