LuciferYang commented on code in PR #42039:
URL: https://github.com/apache/spark/pull/42039#discussion_r1272403827


##########
connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/connect/client/arrow/ArrowEncoderSuite.scala:
##########
@@ -353,8 +355,20 @@ class ArrowEncoderSuite extends ConnectFunSuite with 
BeforeAndAfterAll {
 
   test("nullable fields") {
     val encoder = ScalaReflection.encoderFor[NullableData]
-    val instant = java.time.Instant.now()
-    val now = java.time.LocalDateTime.now()
+    // SPARK-44457: Similar to SPARK-42770, calling 
`truncatedTo(ChronoUnit.MICROS)`
+    // for `java.time.Instant` and `java.time.LocalDateTime` when testing with 
Java 17 on Linux.
+    val needTruncate =
+      SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_17) && 
SystemUtils.IS_OS_LINUX
+    val instant = if (needTruncate) {
+      java.time.Instant.now().truncatedTo(ChronoUnit.MICROS)
+    } else {
+      java.time.Instant.now()
+    }
+    val now = if (needTruncate) {

Review Comment:
   @srowen For this branch, @dongjoon-hyun  suggested maintaining the behavior 
for non special cases in the previous pr
   
   https://github.com/apache/spark/pull/40395#discussion_r1134941041



-- 
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]

Reply via email to