hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject hive git commit: HIVE-15855: throws NPE when using Hplsql UDF (Fei Hui, reviewed by Ferdinand Xu)
Date Fri, 10 Feb 2017 00:23:00 GMT
Repository: hive
Updated Branches:
  refs/heads/master b799bde78 -> c8685b403


HIVE-15855: throws NPE when using Hplsql UDF (Fei Hui, reviewed by Ferdinand Xu)


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

Branch: refs/heads/master
Commit: c8685b40361f89c81de13c905b999929d498c17f
Parents: b799bde
Author: Ferdinand Xu <cheng.a.xu@intel.com>
Authored: Fri Feb 10 00:42:58 2017 +0800
Committer: Ferdinand Xu <cheng.a.xu@intel.com>
Committed: Fri Feb 10 00:42:58 2017 +0800

----------------------------------------------------------------------
 hplsql/src/main/java/org/apache/hive/hplsql/Exec.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/c8685b40/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
----------------------------------------------------------------------
diff --git a/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java b/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
index 18b5eaf..2ad3ea3 100644
--- a/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
+++ b/hplsql/src/main/java/org/apache/hive/hplsql/Exec.java
@@ -144,7 +144,9 @@ public class Exec extends HplsqlBaseVisitor<Integer> {
     else {
       var = new Var(value);
       var.setName(name);
-      exec.currentScope.addVariable(var);
+      if(exec.currentScope != null) {
+        exec.currentScope.addVariable(var);
+      }
     }    
     return var;
   }
@@ -172,7 +174,9 @@ public class Exec extends HplsqlBaseVisitor<Integer> {
     else {
       var = new Var();
       var.setName(name);
-      exec.currentScope.addVariable(var);
+      if(exec.currentScope != null) {
+        exec.currentScope.addVariable(var);
+      }
     }    
     return var;
   }


Mime
View raw message