This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ede693  [fix](insert) modify code logic of InsertStmt (#7360)
6ede693 is described below

commit 6ede693839d035e31794fe3ef5752fc159207486
Author: jakevin <[email protected]>
AuthorDate: Thu Dec 16 10:38:05 2021 +0800

    [fix](insert) modify code logic of InsertStmt (#7360)
    
    when entry is null, there will be NullPointerException.
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java | 6 ++----
 fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java    | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java
index bc12383..de85a09 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/InsertStmt.java
@@ -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 {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
index e12b6f1..30b242c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/PlanNode.java
@@ -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;

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to