Skip to content

Commit

Permalink
[fix](iceberg) fix error when query iceberg table using date predicate (
Browse files Browse the repository at this point in the history
  • Loading branch information
Yulei-Yang authored and Doris-Extras committed Mar 15, 2024
1 parent 0dc0810 commit c85af1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,10 @@ public boolean isDateType() {
return this.type.isDate() || this.type.isDateV2();
}

public boolean isDateTimeType() {
return this.type.isDatetime() || this.type.isDatetimeV2();
}

@Override
public String getStringValue() {
char[] dateTimeChars = new char[26]; // Enough to hold "YYYY-MM-DD HH:MM:SS.mmmmmm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private static Object extractDorisLiteral(Expr expr) {
return boolLiteral.getValue();
} else if (expr instanceof DateLiteral) {
DateLiteral dateLiteral = (DateLiteral) expr;
if (dateLiteral.isDateType()) {
if (dateLiteral.isDateType() || dateLiteral.isDateTimeType()) {
return dateLiteral.getStringValue();
} else {
return dateLiteral.unixTimestamp(TimeUtils.getTimeZone()) * MILLIS_TO_NANO_TIME;
Expand Down

0 comments on commit c85af1b

Please sign in to comment.