saikocat commented on a change in pull request #30902:
URL: https://github.com/apache/spark/pull/30902#discussion_r549241812



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
##########
@@ -628,6 +635,20 @@ class JDBCSuite extends QueryTest
     assert(rows(0).getAs[java.sql.Timestamp](2).getNanos === 543543000)
   }
 
+  test("SPARK-33888 : test TIME types") {
+    val rows = spark.read.jdbc(
+      urlWithUserAndPass, "TEST.TIMETYPES", new Properties()).collect()
+    val cachedRows = spark.read.jdbc(urlWithUserAndPass, "TEST.TIMETYPES", new 
Properties())
+      .cache().collect()
+    val expectedTimeRaw = java.sql.Time.valueOf("12:34:56")
+    val expectedTimeMillis = java.util.concurrent.TimeUnit.SECONDS.toMillis(
+      expectedTimeRaw.toLocalTime().toSecondOfDay()
+    ).toInt
+    assert(rows(0).getAs[java.sql.Time](0) === expectedTimeMillis)

Review comment:
       Result before is `expectedTimeMilllis` for `rows(0)`.
   For `row(1)` then it is `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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to