fix iceberg table get split fail when with date type conjuct (#30162)

This commit is contained in:
GoGoWen
2024-01-27 08:47:36 +08:00
committed by yiguolei
parent bedad15f03
commit e576412a56
2 changed files with 9 additions and 1 deletions

View File

@ -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"

View File

@ -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();