-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-48172][SQL] Fix escaping issues in JDBCDialects #46588
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
|
thanks, merging to master/3.5/3.4! |
This PR is a fix of #46437. The previous PR was reverted as `LONGTEXT` is not supported by all dialects. Special case escaping for MySQL and fix issues with redundant escaping for ' character. New changes introduced in the fix include change `LONGTEXT` -> `VARCHAR(50)`, as well as fix for table naming in the tests. When pushing down startsWith, endsWith and contains they are converted to LIKE. This requires addition of escape characters for these expressions. Unfortunately, MySQL uses ESCAPE '\' syntax instead of ESCAPE '' which would cause errors when trying to push down. Yes Tests for each existing dialect. No. Closes #46588 from mihailom-db/SPARK-48172. Authored-by: Mihailo Milosevic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 9e386b4) Signed-off-by: Wenchen Fan <[email protected]>
This PR is a fix of #46437. The previous PR was reverted as `LONGTEXT` is not supported by all dialects. Special case escaping for MySQL and fix issues with redundant escaping for ' character. New changes introduced in the fix include change `LONGTEXT` -> `VARCHAR(50)`, as well as fix for table naming in the tests. When pushing down startsWith, endsWith and contains they are converted to LIKE. This requires addition of escape characters for these expressions. Unfortunately, MySQL uses ESCAPE '\' syntax instead of ESCAPE '' which would cause errors when trying to push down. Yes Tests for each existing dialect. No. Closes #46588 from mihailom-db/SPARK-48172. Authored-by: Mihailo Milosevic <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 9e386b4) Signed-off-by: Wenchen Fan <[email protected]>
|
https://github.com/apache/spark/actions/workflows/build_branch35.yml These daily jobs for branch-3.4 and 3.5 seem to be broken by this PR? cc @cloud-fan @mihailom-db , also cc @LuciferYang |
|
Getting back from the vacation tomorrow, will take a look at this early in the morning. |
|
Thank you @mihailom-db |
|
Found the error. It seems to be due to the JDK version under which the jobs are run. #46803 this PR proposes a change for 3.4. @yaooqinn @cloud-fan |
### What changes were proposed in this pull request? Removal of stripMargin from the code in `DockerJDBCIntegrationV2Suite`. ### Why are the changes needed? #46588 Given PR was merged to master/3.5/3.4. This PR broke daily jobs for `OracleIntegrationSuite`. Upon inspection, it was noted that 3.4 and 3.5 are run with JDK8 while master is run with JDK21 and stripMargin was behaving differently in those cases. Upon removing stripMargin and spliting `INSERT INTO` statements into multiple lines, all integration tests have passed. ### Does this PR introduce _any_ user-facing change? No, only loading of the test data was changed to follow language requirements. ### How was this patch tested? Existing suite was aborted in the job and now it is running. ### Was this patch authored or co-authored using generative AI tooling? No Closes #46806 Closes #46807 from mihailom-db/FixOracleMaster. Authored-by: Mihailo Milosevic <[email protected]> Signed-off-by: Kent Yao <[email protected]>
### What changes were proposed in this pull request? Removal of stripMargin from the code in `DockerJDBCIntegrationV2Suite`. ### Why are the changes needed? #46588 Given PR was merged to master/3.5/3.4. This PR broke daily jobs for `OracleIntegrationSuite`. Upon inspection, it was noted that 3.4 and 3.5 are run with JDK8 while master is run with JDK21 and stripMargin was behaving differently in those cases. Upon removing stripMargin and spliting `INSERT INTO` statements into multiple lines, all integration tests have passed. ### Does this PR introduce _any_ user-facing change? No, only loading of the test data was changed to follow language requirements. ### How was this patch tested? Existing suite was aborted in the job and now it is running. ### Was this patch authored or co-authored using generative AI tooling? No Closes #46806 Closes #46807 from mihailom-db/FixOracleMaster. Authored-by: Mihailo Milosevic <[email protected]> Signed-off-by: Kent Yao <[email protected]> (cherry picked from commit 4360ec7) Signed-off-by: Kent Yao <[email protected]>
### What changes were proposed in this pull request? Removal of stripMargin from the code in `DockerJDBCIntegrationV2Suite`. ### Why are the changes needed? #46588 Given PR was merged to master/3.5/3.4. This PR broke daily jobs for `OracleIntegrationSuite`. Upon inspection, it was noted that 3.4 and 3.5 are run with JDK8 while master is run with JDK21 and stripMargin was behaving differently in those cases. Upon removing stripMargin and spliting `INSERT INTO` statements into multiple lines, all integration tests have passed. ### Does this PR introduce _any_ user-facing change? No, only loading of the test data was changed to follow language requirements. ### How was this patch tested? Existing suite was aborted in the job and now it is running. ### Was this patch authored or co-authored using generative AI tooling? No Closes #46806 Closes #46807 from mihailom-db/FixOracleMaster. Authored-by: Mihailo Milosevic <[email protected]> Signed-off-by: Kent Yao <[email protected]> (cherry picked from commit 4360ec7) Signed-off-by: Kent Yao <[email protected]>
This PR is a fix of #46437. The previous PR was reverted as
LONGTEXTis not supported by all dialects.What changes were proposed in this pull request?
Special case escaping for MySQL and fix issues with redundant escaping for ' character.
New changes introduced in the fix include change
LONGTEXT->VARCHAR(50), as well as fix for table naming in the tests.Why are the changes needed?
When pushing down startsWith, endsWith and contains they are converted to LIKE. This requires addition of escape characters for these expressions. Unfortunately, MySQL uses ESCAPE '' syntax instead of ESCAPE '' which would cause errors when trying to push down.
Does this PR introduce any user-facing change?
Yes
How was this patch tested?
Tests for each existing dialect.
Was this patch authored or co-authored using generative AI tooling?
No.