asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: fix NPE in ValidateUtil
Date Thu, 01 Sep 2016 17:23:37 GMT
Till Westmann has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1139

Change subject: fix NPE in ValidateUtil
......................................................................

fix NPE in ValidateUtil

Change-Id: I8f623441a3f5b72a9a0621d32d9d1a6aa5567d66
---
M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/39/1139/1

diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
index 13153c2..76e62ae 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/util/ValidateUtil.java
@@ -107,6 +107,10 @@
                     keySourceIndicators);
             for (int fidx = 0; fidx < partitioningExprTypes.size(); ++fidx) {
                 IAType fieldType = partitioningExprTypes.get(fidx);
+                if (fieldType == null) {
+                    throw new AsterixException(
+                            "Type not found for partitioning key \"" + partitioningExprs.get(fidx)
+ "\"");
+                }
                 switch (fieldType.getTypeTag()) {
                     case INT8:
                     case INT16:
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 01a036c..7fde712 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -3024,9 +3024,9 @@
     <test-case FilePath="misc">
       <compilation-unit name="partition-by-nonexistent-field">
         <output-dir compare="Text">partition-by-nonexistent-field</output-dir>
-        <expected-error>java.lang.NullPointerException</expected-error>
-        <expected-error>Cannot find dataset</expected-error>
-        <expected-error>Cannot find dataset testds in dataverse test nor an alias with
name testds</expected-error>
+        <expected-error>Type not found for partitioning key "[id]"</expected-error>
+        <expected-error>Cannot find dataset testds in dataverse test</expected-error>
+        <expected-error>Cannot find dataset testds in dataverse test nor an alias with
name testds!</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="misc">

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1139
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f623441a3f5b72a9a0621d32d9d1a6aa5567d66
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <tillw@apache.org>

Mime
View raw message