This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 0f3700d4342 [BugFix](MultiCatalog) Iceberg table get split fail when
use date type conjunct (#30161)
0f3700d4342 is described below
commit 0f3700d4342bf1a49a2293a59375f22735c1e63a
Author: GoGoWen <[email protected]>
AuthorDate: Thu Feb 1 18:56:20 2024 +0800
[BugFix](MultiCatalog) Iceberg table get split fail when use date type
conjunct (#30161)
#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 29db8d13e90..7d924b0e68c 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
@@ -611,6 +611,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 6b26616b90b..45deff98225 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
@@ -369,7 +369,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: [email protected]
For additional commands, e-mail: [email protected]