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]: report missing variable type only for variables
Date Tue, 05 Jul 2016 20:15:43 GMT
Till Westmann has uploaded a new change for review.

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

Change subject: report missing variable type only for variables
......................................................................

report missing variable type only for variables

Change-Id: I89b7cbb3a93249df959ec17691f5b67dbb2ffda6
---
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AqlExpressionTypeComputer.java
M hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/typing/AbstractTypeEnvironment.java
3 files changed, 8 insertions(+), 8 deletions(-)


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

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 a34689e..5c3ce85 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -6534,7 +6534,7 @@
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="udf30">
         <output-dir compare="Text">udf30</output-dir>
-        <expected-error>Error:</expected-error>
+        <expected-error>Encountered "&lt;EOF&gt;"</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="user-defined-functions">
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AqlExpressionTypeComputer.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AqlExpressionTypeComputer.java
index c5ceb1a..3046321 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AqlExpressionTypeComputer.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AqlExpressionTypeComputer.java
@@ -52,7 +52,12 @@
             case FUNCTION_CALL:
                 return getTypeForFunction((AbstractFunctionCallExpression) expr, env, metadataProvider);
             case VARIABLE:
-                return env.getVarType(((VariableReferenceExpression) expr).getVariableReference());
+                try {
+                    return env.getVarType(((VariableReferenceExpression) expr).getVariableReference());
+                } catch (Exception e) {
+                    throw new AlgebricksException("Could not resolve type for " + expr.toString()
+ ","
+                            + "please check whether the used variable has been defined!",
e);
+                }
             default:
                 throw new IllegalStateException();
         }
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/typing/AbstractTypeEnvironment.java
b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/typing/AbstractTypeEnvironment.java
index 60d0740..c4ff55b 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/typing/AbstractTypeEnvironment.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/typing/AbstractTypeEnvironment.java
@@ -42,12 +42,7 @@
 
     @Override
     public Object getType(ILogicalExpression expr) throws AlgebricksException {
-        try {
-            return expressionTypeComputer.getType(expr, metadataProvider, this);
-        } catch (Exception e) {
-            throw new AlgebricksException("Could not resolve type for " + expr.toString()
+ ","
-                    + "please check whether the used variables has been defined!", e);
-        }
+        return expressionTypeComputer.getType(expr, metadataProvider, this);
     }
 
     @Override

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

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

Mime
View raw message