You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-48172][SQL] Fix escaping issues in JDBCDialects
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]>
Copy file name to clipboardExpand all lines: connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,17 @@ abstract class DockerJDBCIntegrationV2Suite extends DockerJDBCIntegrationSuite {
38
38
.executeUpdate()
39
39
connection.prepareStatement("INSERT INTO employee VALUES (6, 'jen', 12000, 1200)")
Copy file name to clipboardExpand all lines: connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MsSqlServerIntegrationSuite.scala
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,12 @@ class MsSqlServerIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JD
Copy file name to clipboardExpand all lines: connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/MySQLIntegrationSuite.scala
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,12 @@ class MySQLIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTest
88
88
connection.prepareStatement(
89
89
"CREATE TABLE employee (dept INT, name VARCHAR(32), salary DECIMAL(20, 2),"+
Copy file name to clipboardExpand all lines: connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,12 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTes
106
106
connection.prepareStatement(
107
107
"CREATE TABLE employee (dept NUMBER(32), name VARCHAR2(32), salary NUMBER(20, 2),"+
Copy file name to clipboardExpand all lines: connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/PostgresIntegrationSuite.scala
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,12 @@ class PostgresIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCT
59
59
connection.prepareStatement(
60
60
"CREATE TABLE employee (dept INTEGER, name VARCHAR(32), salary NUMERIC(20, 2),"+
0 commit comments