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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6e8037fee64 fix iceberg table get split fail when with date type 
conjuct (#30162)
6e8037fee64 is described below

commit 6e8037fee6450f5e9ad5ba74a23c5446aa1a7c11
Author: GoGoWen <82132356+gogo...@users.noreply.github.com>
AuthorDate: Sat Jan 27 08:47:36 2024 +0800

    fix iceberg table get split fail when with date type conjuct (#30162)
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java | 4 ++++
 .../java/org/apache/doris/external/iceberg/util/IcebergUtils.java   | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
index 8b0921f9b1a..2f7f183b1ad 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
@@ -639,6 +639,10 @@ public class DateLiteral extends LiteralExpr {
         }
     }
 
+    public boolean isDateType() {
+        return this.type.isDate() || this.type.isDateV2();
+    }
+
     @Override
     public String getStringValue() {
         char[] dateTimeChars = new char[26]; // Enough to hold "YYYY-MM-DD 
HH:MM:SS.mmmmmm"
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/external/iceberg/util/IcebergUtils.java
 
b/fe/fe-core/src/main/java/org/apache/doris/external/iceberg/util/IcebergUtils.java
index 4c3ad20a3e1..78a0df2ee6d 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/external/iceberg/util/IcebergUtils.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/external/iceberg/util/IcebergUtils.java
@@ -206,7 +206,11 @@ public class IcebergUtils {
             return boolLiteral.getValue();
         } else if (expr instanceof DateLiteral) {
             DateLiteral dateLiteral = (DateLiteral) expr;
-            return dateLiteral.unixTimestamp(TimeUtils.getTimeZone()) * 
MILLIS_TO_NANO_TIME;
+            if (dateLiteral.isDateType()) {
+                return dateLiteral.getStringValue();
+            } else {
+                return dateLiteral.unixTimestamp(TimeUtils.getTimeZone()) * 
MILLIS_TO_NANO_TIME;
+            }
         } else if (expr instanceof DecimalLiteral) {
             DecimalLiteral decimalLiteral = (DecimalLiteral) expr;
             return decimalLiteral.getValue();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to