[fix](insert) modify code logic of InsertStmt (#7360)

when entry is null, there will be NullPointerException.
This commit is contained in:
jakevin
2021-12-16 10:38:05 +08:00
committed by GitHub
parent 4afdcdb939
commit 6ede693839
2 changed files with 3 additions and 5 deletions

View File

@ -595,7 +595,7 @@ public class InsertStmt extends DdlStmt {
ArrayList<Expr> row = rows.get(rowIdx);
if (!origColIdxsForExtendCols.isEmpty()) {
/**
* we should extends the row for shadow columns.
* we should extend the row for shadow columns.
* eg:
* the origin row has exprs: (expr1, expr2, expr3), and targetColumns is (A, B, C, __doris_shadow_b)
* after processing, extentedRow is (expr1, expr2, expr3, expr2)
@ -604,9 +604,7 @@ public class InsertStmt extends DdlStmt {
extentedRow.addAll(row);
for (Pair<Integer, Column> entry : origColIdxsForExtendCols) {
if (entry == null) {
extentedRow.add(extentedRow.get(entry.first));
} else {
if (entry != null) {
if (entry.second == null) {
extentedRow.add(extentedRow.get(entry.first));
} else {

View File

@ -153,7 +153,7 @@ abstract public class PlanNode extends TreeNode<PlanNode> {
}
/**
* Copy c'tor. Also passes in new id.
* Copy ctor. Also passes in new id.
*/
protected PlanNode(PlanNodeId id, PlanNode node, String planNodeName) {
this.id = id;