[Bug](delete) Use date as common type for date comparison (#25262)

This commit is contained in:
Gabriel
2023-10-11 11:51:43 +08:00
committed by GitHub
parent bb670118f5
commit 0d603dd4c3

View File

@ -404,6 +404,8 @@ public class BinaryPredicate extends Predicate implements Writable {
} else if (getChild(1).getType().isDate()
&& (getChild(0).getType().isStringType() && getChild(0) instanceof StringLiteral)) {
return ((StringLiteral) getChild(0)).canConvertToDateType(Type.DATE) ? Type.DATE : Type.DATETIME;
} else if (getChild(1).getType().isDate() && getChild(0).getType().isDate()) {
return Type.DATE;
} else {
return Type.DATETIME;
}