[SQL] Fix TupleIsNull miss in SelectStmt resultExpr (#4279)

This commit is contained in:
HangyuanLiu
2020-08-26 10:27:50 +08:00
committed by GitHub
parent d5a0a738f4
commit b1c7841c20
2 changed files with 3 additions and 1 deletions

View File

@ -195,7 +195,7 @@ public class Planner {
exprs, rootFragment.getPlanRoot().getOutputSmap(), analyzer, true);
rootFragment.setOutputExprs(resExprs);
} else {
List<Expr> resExprs = Expr.substituteList(queryStmt.getBaseTblResultExprs(),
List<Expr> resExprs = Expr.substituteList(queryStmt.getResultExprs(),
rootFragment.getPlanRoot().getOutputSmap(), analyzer, false);
rootFragment.setOutputExprs(resExprs);
}

View File

@ -1036,6 +1036,8 @@ public class SingleNodePlanner {
}
unionNode.setTblRefIds(Lists.newArrayList(inlineViewRef.getId()));
unionNode.addConstExprList(selectStmt.getBaseTblResultExprs());
//set outputSmap to substitute literal in outputExpr
unionNode.setOutputSmap(inlineViewRef.getSmap());
unionNode.init(analyzer);
return unionNode;
}