fix iceberg table get split fail when with date type conjuct (#30162)
This commit is contained in:
@ -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"
|
||||
|
||||
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user