huaxingao commented on a change in pull request #35283:
URL: https://github.com/apache/spark/pull/35283#discussion_r791273969
##########
File path:
external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/DB2IntegrationSuite.scala
##########
@@ -198,4 +198,26 @@ class DB2IntegrationSuite extends
DockerJDBCIntegrationSuite {
""".stripMargin.replaceAll("\n", " "))
assert(sql("select x, y from queryOption").collect.toSet == expectedResult)
}
+
+ test("SPARK-30062") {
+ val expectedResult = Set(
+ (42, "fred"),
+ (17, "dave")
+ ).map { case (x, y) =>
+ Row(Integer.valueOf(x), String.valueOf(y))
+ }
+ val df = sqlContext.read.jdbc(jdbcUrl, "tbl", new Properties).cache
Review comment:
nit: I think we don't have to cache it.
##########
File path:
external/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/DB2IntegrationSuite.scala
##########
@@ -198,4 +198,26 @@ class DB2IntegrationSuite extends
DockerJDBCIntegrationSuite {
""".stripMargin.replaceAll("\n", " "))
assert(sql("select x, y from queryOption").collect.toSet == expectedResult)
}
+
+ test("SPARK-30062") {
+ val expectedResult = Set(
+ (42, "fred"),
+ (17, "dave")
+ ).map { case (x, y) =>
+ Row(Integer.valueOf(x), String.valueOf(y))
+ }
+ val df = sqlContext.read.jdbc(jdbcUrl, "tbl", new Properties).cache
+ df.write.mode(SaveMode.Append)
+ .jdbc(jdbcUrl, "tblcopy", new Properties)
+ df.write.mode(SaveMode.Append)
+ .jdbc(jdbcUrl, "tblcopy", new Properties)
+ df.write.mode(SaveMode.Append)
+ .jdbc(jdbcUrl, "tblcopy", new Properties)
Review comment:
nit: put these in a loop?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]