[fix](planner) Keep type of null literal expr when register conjuncts (#15878)

For now, type information of child expr which is NullLiteral would get lost in the CastExpr#getResultValue, this will produce a NullLiteral with Null  type which cause BE core when doing cast
This commit is contained in:
AKIRA
2023-01-17 16:48:02 +08:00
committed by GitHub
parent bbdf40b6bd
commit 38663526b7
4 changed files with 56 additions and 2 deletions

View File

@ -417,7 +417,7 @@ public class CastExpr extends Expr {
private Expr castTo(LiteralExpr value) throws AnalysisException {
if (value instanceof NullLiteral) {
return value;
return NullLiteral.create(targetTypeDef.getType());
} else if (type.isIntegerType()) {
return new IntLiteral(value.getLongValue(), type);
} else if (type.isLargeIntType()) {

View File

@ -75,7 +75,7 @@ public class FunctionParams implements Writable {
}
public TAggregateExpr createTAggregateExpr(boolean isMergeAggFn) {
List<TTypeDesc> paramTypes = new ArrayList<TTypeDesc>();
List<TTypeDesc> paramTypes = new ArrayList<>();
if (exprs != null) {
for (Expr expr : exprs) {
TTypeDesc desc = expr.getType().toThrift();