HyukjinKwon commented on code in PR #45790:
URL: https://github.com/apache/spark/pull/45790#discussion_r1546165175
##########
connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/MySQLIntegrationSuite.scala:
##########
@@ -337,6 +339,27 @@ class MySQLIntegrationSuite extends
DockerJDBCIntegrationSuite {
checkAnswer(df,
Row(Array[Byte](0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0)))
}
+<<<<<<< Updated upstream
+=======
+
+ test("SPARK-47665: Read/write round-trip for ShortType") {
+ spark.range(3)
+ .selectExpr("CAST(id AS SMALLINT) AS id")
+ .write
+ .jdbc(jdbcUrl, "smallint_round_trip", new Properties)
+ val df = spark.read.jdbc(jdbcUrl, "smallint_round_trip", new Properties)
+ assert(df.schema.fields.head.dataType === ShortType)
+ }
+
+ test("SPARK-47666: Check nulls for result set getters") {
+ Seq("true", "false").foreach { flag =>
+ withSQLConf(SQLConf.LEGACY_MYSQL_BIT_ARRAY_MAPPING_ENABLED.key -> flag) {
+ val nulls = spark.read.jdbc(jdbcUrl, "numbers", new
Properties).tail(1).head
+ assert(nulls === Row(null, null, null, null, null, null, null, null,
null, null))
+ }
+ }
+ }
+>>>>>>> Stashed changes
Review Comment:
```suggestion
test("SPARK-47665: Read/write round-trip for ShortType") {
spark.range(3)
.selectExpr("CAST(id AS SMALLINT) AS id")
.write
.jdbc(jdbcUrl, "smallint_round_trip", new Properties)
val df = spark.read.jdbc(jdbcUrl, "smallint_round_trip", new Properties)
assert(df.schema.fields.head.dataType === ShortType)
}
test("SPARK-47666: Check nulls for result set getters") {
Seq("true", "false").foreach { flag =>
withSQLConf(SQLConf.LEGACY_MYSQL_BIT_ARRAY_MAPPING_ENABLED.key ->
flag) {
val nulls = spark.read.jdbc(jdbcUrl, "numbers", new
Properties).tail(1).head
assert(nulls === Row(null, null, null, null, null, null, null, null,
null, null))
}
}
}
```
--
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]