Skip to content

Commit 4360ec7

Browse files
mihailom-dbyaooqinn
authored andcommitted
[SPARK-48172][SQL][FOLLOWUP] Fix escaping issues in JDBCDialects
### 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]>
1 parent 80addbb commit 4360ec7

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,24 @@ abstract class DockerJDBCIntegrationV2Suite extends DockerJDBCIntegrationSuite {
3939
connection.prepareStatement("INSERT INTO employee VALUES (6, 'jen', 12000, 1200)")
4040
.executeUpdate()
4141

42-
connection.prepareStatement(
43-
s"""
44-
|INSERT INTO pattern_testing_table VALUES
45-
|('special_character_quote''_present'),
46-
|('special_character_quote_not_present'),
47-
|('special_character_percent%_present'),
48-
|('special_character_percent_not_present'),
49-
|('special_character_underscore_present'),
50-
|('special_character_underscorenot_present')
51-
""".stripMargin).executeUpdate()
42+
connection.prepareStatement("INSERT INTO pattern_testing_table "
43+
+ "VALUES ('special_character_quote''_present')")
44+
.executeUpdate()
45+
connection.prepareStatement("INSERT INTO pattern_testing_table "
46+
+ "VALUES ('special_character_quote_not_present')")
47+
.executeUpdate()
48+
connection.prepareStatement("INSERT INTO pattern_testing_table "
49+
+ "VALUES ('special_character_percent%_present')")
50+
.executeUpdate()
51+
connection.prepareStatement("INSERT INTO pattern_testing_table "
52+
+ "VALUES ('special_character_percent_not_present')")
53+
.executeUpdate()
54+
connection.prepareStatement("INSERT INTO pattern_testing_table "
55+
+ "VALUES ('special_character_underscore_present')")
56+
.executeUpdate()
57+
connection.prepareStatement("INSERT INTO pattern_testing_table "
58+
+ "VALUES ('special_character_underscorenot_present')")
59+
.executeUpdate()
5260
}
5361

5462
def tablePreparation(connection: Connection): Unit

0 commit comments

Comments
 (0)