You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by ti...@apache.org on 2016/07/06 16:27:56 UTC
asterixdb git commit: report missing variable type only for variables
Repository: asterixdb
Updated Branches:
refs/heads/master a8baf6df7 -> ea36aa65e
report missing variable type only for variables
Change-Id: I89b7cbb3a93249df959ec17691f5b67dbb2ffda6
Reviewed-on: https://asterix-gerrit.ics.uci.edu/975
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <bu...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/ea36aa65
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/ea36aa65
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/ea36aa65
Branch: refs/heads/master
Commit: ea36aa65e8df0bfc128e19872f58b130272239b9
Parents: a8baf6d
Author: Till Westmann <ti...@apache.org>
Authored: Tue Jul 5 21:01:00 2016 -0700
Committer: Till Westmann <ti...@apache.org>
Committed: Wed Jul 6 09:27:12 2016 -0700
----------------------------------------------------------------------
.../dataflow/data/common/AqlExpressionTypeComputer.java | 7 ++++++-
.../core/algebra/typing/AbstractTypeEnvironment.java | 7 +------
2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ea36aa65/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/common/AqlExpressionTypeComputer.java
----------------------------------------------------------------------
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 @@ public class AqlExpressionTypeComputer implements IExpressionTypeComputer {
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();
}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/ea36aa65/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/typing/AbstractTypeEnvironment.java
----------------------------------------------------------------------
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 @@ public abstract class AbstractTypeEnvironment implements IVariableTypeEnvironmen
@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