From dd95847a6bd43db1c2557c077409d054854165b8 Mon Sep 17 00:00:00 2001 From: kakavenkat Date: Sat, 21 Dec 2024 03:39:05 +0530 Subject: [PATCH] fixing the timestamp converting to long --- .../org/apache/iceberg/spark/SparkValueConverter.java | 8 ++------ 1 file changed, 2 insertions(+), 6 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 28b717ac090e..ce14f569e800 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 @@ -68,16 +68,12 @@ public static Object convert(Type type, Object object) { } return convertedMap; - case DATE: - // if spark.sql.datetime.java8API.enabled is set to true, java.time.LocalDate - // for Spark SQL DATE type otherwise java.sql.Date is returned. - return DateTimeUtils.anyToDays(object); - case TIMESTAMP: - return DateTimeUtils.anyToMicros(object); case BINARY: return ByteBuffer.wrap((byte[]) object); case INTEGER: return ((Number) object).intValue(); + case DATE: + case TIMESTAMP: case BOOLEAN: case LONG: case FLOAT: