This is an automated email from the ASF dual-hosted git repository.

aokolnychyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new 5aa0b2ede6 Spark 3.5: Remove date logic with `anyToMicros` (#8585)
5aa0b2ede6 is described below

commit 5aa0b2ede62bb06454d374d4f9ef614c363fb83a
Author: Fokko Driesprong <[email protected]>
AuthorDate: Tue Sep 19 22:24:50 2023 +0200

    Spark 3.5: Remove date logic with `anyToMicros` (#8585)
---
 .../java/org/apache/iceberg/spark/SparkValueConverter.java  | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git 
a/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkValueConverter.java
 
b/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkValueConverter.java
index 53fb7ec44a..28b717ac09 100644
--- 
a/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkValueConverter.java
+++ 
b/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/SparkValueConverter.java
@@ -19,7 +19,6 @@
 package org.apache.iceberg.spark;
 
 import java.nio.ByteBuffer;
-import java.time.LocalDateTime;
 import java.util.List;
 import java.util.Map;
 import org.apache.iceberg.Schema;
@@ -74,17 +73,7 @@ public class SparkValueConverter {
         // for Spark SQL DATE type otherwise java.sql.Date is returned.
         return DateTimeUtils.anyToDays(object);
       case TIMESTAMP:
-        Types.TimestampType ts = (Types.TimestampType) type.asPrimitiveType();
-
-        // This if/else can be removed once 
https://github.com/apache/spark/pull/41238 is in
-        if (ts.shouldAdjustToUTC()) {
-          // if spark.sql.datetime.java8API.enabled is set to true, 
java.time.Instant
-          // for Spark SQL TIMESTAMP type is returned otherwise 
java.sql.Timestamp is returned.
-          return DateTimeUtils.anyToMicros(object);
-        } else {
-          LocalDateTime ldt = (LocalDateTime) object;
-          return DateTimeUtils.localDateTimeToMicros(ldt);
-        }
+        return DateTimeUtils.anyToMicros(object);
       case BINARY:
         return ByteBuffer.wrap((byte[]) object);
       case INTEGER:

Reply via email to