[fix](iceberg) fix error when query iceberg table using date predicate (#32194)
This commit is contained in:
@ -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"
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user