From 33e27a852f2f2e66ee29e92cdc406a016792b160 Mon Sep 17 00:00:00 2001 From: Mihailo Milosevic Date: Thu, 30 May 2024 09:54:27 +0200 Subject: [PATCH 1/4] Fix OracleIntegrationSuit --- .../org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala index 4dbe32fd695f..733caefcf383 100644 --- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala +++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala @@ -85,7 +85,7 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTes " bonus BINARY_DOUBLE)").executeUpdate() connection.prepareStatement( s"""CREATE TABLE pattern_testing_table ( - |pattern_testing_col VARCHAR(50) + |pattern_testing_col VARCHAR2(50) |) """.stripMargin ).executeUpdate() From 7bb6e44e66f58eee9b8e4f3441552536c6693d60 Mon Sep 17 00:00:00 2001 From: Mihailo Milosevic Date: Thu, 30 May 2024 10:15:51 +0200 Subject: [PATCH 2/4] Fix problem of escaping in test --- .../apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala | 2 +- .../org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala index 5f4f0b7a3afb..a42caeafe6fe 100644 --- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala +++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala @@ -42,7 +42,7 @@ abstract class DockerJDBCIntegrationV2Suite extends DockerJDBCIntegrationSuite { connection.prepareStatement( s""" |INSERT INTO pattern_testing_table VALUES - |('special_character_quote''_present'), + |('special_character_quote\\'_present'), |('special_character_quote_not_present'), |('special_character_percent%_present'), |('special_character_percent_not_present'), diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala index 733caefcf383..4dbe32fd695f 100644 --- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala +++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/OracleIntegrationSuite.scala @@ -85,7 +85,7 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationV2Suite with V2JDBCTes " bonus BINARY_DOUBLE)").executeUpdate() connection.prepareStatement( s"""CREATE TABLE pattern_testing_table ( - |pattern_testing_col VARCHAR2(50) + |pattern_testing_col VARCHAR(50) |) """.stripMargin ).executeUpdate() From 9ec32c72843e1f874386b8c7a2ed81d54dfcb9bd Mon Sep 17 00:00:00 2001 From: Mihailo Milosevic Date: Thu, 30 May 2024 11:00:15 +0200 Subject: [PATCH 3/4] Rework insertion --- .../v2/DockerJDBCIntegrationV2Suite.scala | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala index a42caeafe6fe..ab36f9eba08c 100644 --- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala +++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala @@ -39,16 +39,18 @@ abstract class DockerJDBCIntegrationV2Suite extends DockerJDBCIntegrationSuite { connection.prepareStatement("INSERT INTO employee VALUES (6, 'jen', 12000, 1200)") .executeUpdate() - connection.prepareStatement( - s""" - |INSERT INTO pattern_testing_table VALUES - |('special_character_quote\\'_present'), - |('special_character_quote_not_present'), - |('special_character_percent%_present'), - |('special_character_percent_not_present'), - |('special_character_underscore_present'), - |('special_character_underscorenot_present') - """.stripMargin).executeUpdate() + connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_quote''_present')") + .executeUpdate() + connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_quote_not_present')") + .executeUpdate() + connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_percent%_present')") + .executeUpdate() + connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_percent_not_present')") + .executeUpdate() + connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_underscore_present')") + .executeUpdate() + connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_underscorenot_present')") + .executeUpdate() } def tablePreparation(connection: Connection): Unit From 54ea0a774d8dab51e02073f47ae46ed4e7398304 Mon Sep 17 00:00:00 2001 From: Mihailo Milosevic Date: Thu, 30 May 2024 11:15:09 +0200 Subject: [PATCH 4/4] Update DockerJDBCIntegrationV2Suite.scala --- .../jdbc/v2/DockerJDBCIntegrationV2Suite.scala | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala index ab36f9eba08c..706b87fa65da 100644 --- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala +++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/v2/DockerJDBCIntegrationV2Suite.scala @@ -39,17 +39,23 @@ abstract class DockerJDBCIntegrationV2Suite extends DockerJDBCIntegrationSuite { connection.prepareStatement("INSERT INTO employee VALUES (6, 'jen', 12000, 1200)") .executeUpdate() - connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_quote''_present')") + connection.prepareStatement("INSERT INTO pattern_testing_table " + + "VALUES ('special_character_quote''_present')") .executeUpdate() - connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_quote_not_present')") + connection.prepareStatement("INSERT INTO pattern_testing_table " + + "VALUES ('special_character_quote_not_present')") .executeUpdate() - connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_percent%_present')") + connection.prepareStatement("INSERT INTO pattern_testing_table " + + "VALUES ('special_character_percent%_present')") .executeUpdate() - connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_percent_not_present')") + connection.prepareStatement("INSERT INTO pattern_testing_table " + + "VALUES ('special_character_percent_not_present')") .executeUpdate() - connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_underscore_present')") + connection.prepareStatement("INSERT INTO pattern_testing_table " + + "VALUES ('special_character_underscore_present')") .executeUpdate() - connection.prepareStatement("INSERT INTO pattern_testing_table VALUES ('special_character_underscorenot_present')") + connection.prepareStatement("INSERT INTO pattern_testing_table " + + "VALUES ('special_character_underscorenot_present')") .executeUpdate() }