[fix](iceberg) fix error when query iceberg table using date predicate (#32194)

This commit is contained in:
Yulei-Yang
2024-03-14 10:33:12 +08:00
committed by yiguolei
parent 0dc081088c
commit c85af1bfd6
2 changed files with 5 additions and 1 deletions

View File

@ -683,6 +683,10 @@ public class DateLiteral extends LiteralExpr {
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"

View File

@ -229,7 +229,7 @@ public class IcebergUtils {
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;