You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2020/10/13 16:16:53 UTC

[iceberg] branch master updated: Hive: Fix filter conversion with Date (#1579)

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

blue 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 7355727  Hive: Fix filter conversion with Date (#1579)
7355727 is described below

commit 7355727cb4484daf0278c7b503c75a4f20f22ffb
Author: Kyle Bendickson <98...@users.noreply.github.com>
AuthorDate: Tue Oct 13 09:16:44 2020 -0700

    Hive: Fix filter conversion with Date (#1579)
---
 .../main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java b/mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java
index c800f72..d4239ef 100644
--- a/mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java
+++ b/mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergFilterFactory.java
@@ -22,6 +22,7 @@ package org.apache.iceberg.mr.hive;
 import java.math.BigDecimal;
 import java.sql.Date;
 import java.sql.Timestamp;
+import java.time.Instant;
 import java.util.List;
 import java.util.stream.Collectors;
 import org.apache.hadoop.hive.ql.io.sarg.ExpressionTree;
@@ -169,7 +170,7 @@ public class HiveIcebergFilterFactory {
   }
 
   private static int daysFromDate(Date date) {
-    return DateTimeUtil.daysFromDate(date.toLocalDate());
+    return DateTimeUtil.daysFromInstant(Instant.ofEpochMilli(date.getTime()));
   }
 
   private static int daysFromTimestamp(Timestamp timestamp) {