IMPALA-5235: Initialize resourceProfile_ with a dummy value

resourceProfile_ is initialized to NULL and gets set later while
finalizing the plan fragment. resourceProfile_ is accessed in
createHashJoinFragment before it gets set. Accessing it before
throws a NullPointerException. This change initializes it with a dummy
value instead of null to avoid this.
This code path gets executed only with log_level=3

Change-Id: I02de2ca1f627d7f61921840722661a5323e91579
Reviewed-on: http://gerrit.cloudera.org:8080/6750
Reviewed-by: Alex Behm <[email protected]>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/ac2217b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/ac2217b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/ac2217b6

Branch: refs/heads/master
Commit: ac2217b69ee043a5abd03ad876481a7e5c7437fd
Parents: c1be774
Author: aphadke <[email protected]>
Authored: Wed Apr 26 13:45:30 2017 -0700
Committer: Impala Public Jenkins <[email protected]>
Committed: Sat Apr 29 03:34:15 2017 +0000

----------------------------------------------------------------------
 fe/src/main/java/org/apache/impala/planner/PlanNode.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/ac2217b6/fe/src/main/java/org/apache/impala/planner/PlanNode.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/planner/PlanNode.java 
b/fe/src/main/java/org/apache/impala/planner/PlanNode.java
index d5c72a0..b6c3763 100644
--- a/fe/src/main/java/org/apache/impala/planner/PlanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/PlanNode.java
@@ -115,8 +115,9 @@ abstract public class PlanNode extends TreeNode<PlanNode> {
   protected int numNodes_;
 
   // resource requirements and estimates for this plan node.
-  // set in computeResourceProfile().
-  protected ResourceProfile resourceProfile_ = null;
+  // Initialized with a dummy value. Gets set correctly in
+  // computeResourceProfile().
+  protected ResourceProfile resourceProfile_ = ResourceProfile.invalid();
 
   // sum of tupleIds_' avgSerializedSizes; set in computeStats()
   protected float avgRowSize_;

Reply via email to