From eb22eb744d523600f3f224342bf23e72af094c9d Mon Sep 17 00:00:00 2001 From: Peter Vary Date: Sun, 28 Feb 2021 19:49:26 +0100 Subject: [PATCH] Hive: Quick fix for broken TestHiveIcebergFilterFactory.testTimestampType test --- .../apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java b/mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java index 3044f0467af3..dc48501e3084 100644 --- a/mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java +++ b/mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergFilterFactory.java @@ -23,7 +23,6 @@ import java.sql.Date; import java.sql.Timestamp; import java.time.LocalDate; -import java.time.ZoneOffset; import org.apache.hadoop.hive.ql.io.sarg.PredicateLeaf; import org.apache.hadoop.hive.ql.io.sarg.SearchArgument; import org.apache.hadoop.hive.ql.io.sarg.SearchArgumentFactory; @@ -231,7 +230,7 @@ public void testDateType() { public void testTimestampType() { Literal timestampLiteral = Literal.of("2012-10-02T05:16:17.123456").to(Types.TimestampType.withoutZone()); long timestampMicros = timestampLiteral.value(); - Timestamp ts = Timestamp.from(DateTimeUtil.timestampFromMicros(timestampMicros).toInstant(ZoneOffset.UTC)); + Timestamp ts = Timestamp.valueOf(DateTimeUtil.timestampFromMicros(timestampMicros)); SearchArgument.Builder builder = SearchArgumentFactory.newBuilder(); SearchArgument arg = builder.startAnd().equals("timestamp", PredicateLeaf.Type.TIMESTAMP, ts).end().build();