asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjaco...@apache.org
Subject [1/7] asterixdb git commit: Change the compilation related Exception
Date Mon, 16 Jan 2017 18:46:45 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master b29bd73dc -> e65e6ca45


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
index 81aba54..9579741 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
@@ -21,10 +21,10 @@ package org.apache.asterix.lang.sqlpp.visitor;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
+import org.apache.asterix.lang.common.base.Clause.ClauseType;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.ILangExpression;
-import org.apache.asterix.lang.common.base.Clause.ClauseType;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
 import org.apache.asterix.lang.common.clause.LetClause;
 import org.apache.asterix.lang.common.clause.LimitClause;
@@ -68,7 +68,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(FromClause fromClause,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         VariableSubstitutionEnvironment currentEnv = new VariableSubstitutionEnvironment(env);
         List<FromTerm> newFromTerms = new ArrayList<>();
         for (FromTerm fromTerm : fromClause.getFromTerms()) {
@@ -83,7 +83,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(FromTerm fromTerm,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         VariableExpr leftVar = fromTerm.getLeftVariable();
         VariableExpr newLeftVar = generateNewVariable(context, leftVar);
         VariableExpr newLeftPosVar = fromTerm.hasPositionalVariable() ? generateNewVariable(context,
@@ -120,7 +120,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(JoinClause joinClause,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         VariableExpr rightVar = joinClause.getRightVariable();
         VariableExpr newRightVar = generateNewVariable(context, rightVar);
         VariableExpr newRightPosVar = joinClause.hasPositionalVariable() ? generateNewVariable(context,
@@ -145,7 +145,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(NestClause nestClause,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         VariableExpr rightVar = nestClause.getRightVariable();
         VariableExpr newRightVar = generateNewVariable(context, rightVar);
         VariableExpr newRightPosVar = nestClause.hasPositionalVariable() ? generateNewVariable(context,
@@ -170,7 +170,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(UnnestClause unnestClause,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         VariableExpr rightVar = unnestClause.getRightVariable();
         VariableExpr newRightVar = generateNewVariable(context, rightVar);
         VariableExpr newRightPosVar = unnestClause.hasPositionalVariable() ? generateNewVariable(context,
@@ -193,7 +193,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(Projection projection,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         if (projection.star()) {
             return new Pair<>(projection, env);
         }
@@ -204,7 +204,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(SelectBlock selectBlock,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> newFrom = null;
         Pair<ILangExpression, VariableSubstitutionEnvironment> newLet;
         Pair<ILangExpression, VariableSubstitutionEnvironment> newWhere = null;
@@ -262,7 +262,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(SelectClause selectClause,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         boolean distinct = selectClause.distinct();
         if (selectClause.selectElement()) {
             Pair<ILangExpression, VariableSubstitutionEnvironment> newSelectElement = selectClause.getSelectElement()
@@ -279,7 +279,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(SelectElement selectElement,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> newExpr = selectElement.getExpression()
                 .accept(this, env);
         return new Pair<>(new SelectElement((Expression) newExpr.first), newExpr.second);
@@ -287,7 +287,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(SelectRegular selectRegular,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Projection> newProjections = new ArrayList<>();
         for (Projection projection : selectRegular.getProjections()) {
             newProjections.add((Projection) projection.accept(this, env).first);
@@ -297,7 +297,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(SelectSetOperation selectSetOperation,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         SetOperationInput leftInput = selectSetOperation.getLeftInput();
         SetOperationInput newLeftInput;
 
@@ -335,7 +335,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(SelectExpression selectExpression,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         boolean subquery = selectExpression.isSubquery();
         List<LetClause> newLetList = new ArrayList<>();
         SelectSetOperation newSelectSetOperation;
@@ -374,7 +374,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(HavingClause havingClause,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p = havingClause.getFilterExpression().accept(this, env);
         HavingClause newHavingClause = new HavingClause((Expression) p.first);
         return new Pair<>(newHavingClause, p.second);
@@ -382,7 +382,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(IndependentSubquery independentSubquery,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p = independentSubquery.getExpr().accept(this, env);
         IndependentSubquery newSubquery = new IndependentSubquery((Expression) p.first);
         return new Pair<>(newSubquery, p.second);
@@ -390,7 +390,7 @@ public class SqlppCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteV
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(CaseExpression caseExpr,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Expression conditionExpr = (Expression) caseExpr.getConditionExpr().accept(this, env).first;
         List<Expression> whenExprList = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(caseExpr.getWhenExprs(),
                 env, this);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppFormatPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppFormatPrintVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppFormatPrintVisitor.java
index 1beba9b..a62a1cc 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppFormatPrintVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppFormatPrintVisitor.java
@@ -21,7 +21,7 @@ package org.apache.asterix.lang.sqlpp.visitor;
 import java.io.PrintWriter;
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
 import org.apache.asterix.lang.common.clause.LetClause;
@@ -68,7 +68,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(FromClause fromClause, Integer step) throws AsterixException {
+    public Void visit(FromClause fromClause, Integer step) throws CompilationException {
         out.print(skip(step) + "from ");
         int index = 0;
         for (FromTerm fromTerm : fromClause.getFromTerms()) {
@@ -83,7 +83,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(FromTerm fromTerm, Integer step) throws AsterixException {
+    public Void visit(FromTerm fromTerm, Integer step) throws CompilationException {
         fromTerm.getLeftExpression().accept(this, step + 2);
         out.print(" as ");
         fromTerm.getLeftVariable().accept(this, step + 2);
@@ -100,7 +100,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(JoinClause joinClause, Integer step) throws AsterixException {
+    public Void visit(JoinClause joinClause, Integer step) throws CompilationException {
         out.print(joinClause.getJoinType());
         joinClause.getRightExpression().accept(this, step + 2);
         out.print(" as ");
@@ -114,7 +114,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(NestClause nestClause, Integer step) throws AsterixException {
+    public Void visit(NestClause nestClause, Integer step) throws CompilationException {
         out.print(nestClause.getJoinType());
         nestClause.getRightExpression().accept(this, step + 2);
         out.println(skip(step + 1) + " as ");
@@ -128,7 +128,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(Projection projection, Integer step) throws AsterixException {
+    public Void visit(Projection projection, Integer step) throws CompilationException {
         if (projection.star()) {
             out.print(" * ");
             return null;
@@ -142,7 +142,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(SelectBlock selectBlock, Integer step) throws AsterixException {
+    public Void visit(SelectBlock selectBlock, Integer step) throws CompilationException {
         selectBlock.getSelectClause().accept(this, step);
         if (selectBlock.hasFromClause()) {
             selectBlock.getFromClause().accept(this, step);
@@ -170,7 +170,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(SelectClause selectClause, Integer step) throws AsterixException {
+    public Void visit(SelectClause selectClause, Integer step) throws CompilationException {
         if (selectClause.selectRegular()) {
             selectClause.getSelectRegular().accept(this, step);
         }
@@ -182,14 +182,14 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(SelectElement selectElement, Integer step) throws AsterixException {
+    public Void visit(SelectElement selectElement, Integer step) throws CompilationException {
         out.print("select element ");
         selectElement.getExpression().accept(this, step);
         return null;
     }
 
     @Override
-    public Void visit(SelectRegular selectRegular, Integer step) throws AsterixException {
+    public Void visit(SelectRegular selectRegular, Integer step) throws CompilationException {
         out.print("select ");
         int index = 0;
         for (Projection projection : selectRegular.getProjections()) {
@@ -203,7 +203,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(SelectSetOperation selectSetOperation, Integer step) throws AsterixException {
+    public Void visit(SelectSetOperation selectSetOperation, Integer step) throws CompilationException {
         selectSetOperation.getLeftInput().accept(this, step);
         if (selectSetOperation.hasRightInputs()) {
             for (SetOperationRight right : selectSetOperation.getRightInputs()) {
@@ -216,7 +216,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(SelectExpression selectStatement, Integer step) throws AsterixException {
+    public Void visit(SelectExpression selectStatement, Integer step) throws CompilationException {
         if (selectStatement.isSubquery()) {
             out.print("(");
         }
@@ -240,7 +240,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(UnnestClause unnestClause, Integer step) throws AsterixException {
+    public Void visit(UnnestClause unnestClause, Integer step) throws CompilationException {
         out.print(unnestClause.getJoinType());
         unnestClause.getRightExpression().accept(this, step + 2);
         out.print(" as ");
@@ -253,7 +253,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(HavingClause havingClause, Integer step) throws AsterixException {
+    public Void visit(HavingClause havingClause, Integer step) throws CompilationException {
         out.print(skip(step) + " having ");
         havingClause.getFilterExpression().accept(this, step + 2);
         out.println();
@@ -261,7 +261,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(GroupbyClause gc, Integer step) throws AsterixException {
+    public Void visit(GroupbyClause gc, Integer step) throws CompilationException {
         if (gc.hasHashGroupByHint()) {
             out.println(skip(step) + "/* +hash */");
         }
@@ -272,7 +272,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(InsertStatement insert, Integer step) throws AsterixException {
+    public Void visit(InsertStatement insert, Integer step) throws CompilationException {
         out.print(skip(step) + "insert into " + datasetSymbol
                 + generateFullName(insert.getDataverseName(), insert.getDatasetName()) + "\n");
         insert.getQuery().accept(this, step);
@@ -281,7 +281,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(LetClause lc, Integer step) throws AsterixException {
+    public Void visit(LetClause lc, Integer step) throws CompilationException {
         out.print(skip(step) + "with ");
         Expression bindingExpr = lc.getBindingExpr();
         bindingExpr.accept(this, step + 2);
@@ -293,7 +293,7 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
 
     @Override
     protected void printDelimitedGbyExpressions(List<GbyVariableExpressionPair> gbyList, int step)
-            throws AsterixException {
+            throws CompilationException {
         int gbySize = gbyList.size();
         int gbyIndex = 0;
         for (GbyVariableExpressionPair pair : gbyList) {
@@ -309,13 +309,13 @@ public class SqlppFormatPrintVisitor extends FormatPrintVisitor implements ISqlp
     }
 
     @Override
-    public Void visit(IndependentSubquery independentSubquery, Integer step) throws AsterixException {
+    public Void visit(IndependentSubquery independentSubquery, Integer step) throws CompilationException {
         independentSubquery.getExpr().accept(this, step);
         return null;
     }
 
     @Override
-    public Void visit(CaseExpression caseExpr, Integer step) throws AsterixException {
+    public Void visit(CaseExpression caseExpr, Integer step) throws CompilationException {
         out.print(skip(step) + "case ");
         caseExpr.getConditionExpr().accept(this, step + 2);
         out.println();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppSubstituteExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppSubstituteExpressionVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppSubstituteExpressionVisitor.java
index 9b19d7c..39229e2 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppSubstituteExpressionVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppSubstituteExpressionVisitor.java
@@ -22,7 +22,7 @@ import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.context.Scope;
 import org.apache.asterix.lang.common.expression.VariableExpr;
@@ -49,7 +49,7 @@ public class SqlppSubstituteExpressionVisitor extends AbstractSqlppExpressionSco
     // An example is:
     // asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/group-by/gby-expr-3/gby-expr-3.3.query.sqlpp
     @Override
-    protected Expression preVisit(Expression expr) throws AsterixException {
+    protected Expression preVisit(Expression expr) throws CompilationException {
         Expression mappedExpr = exprMap.get(expr);
         if (mappedExpr == null) {
             return expr;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppAstVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppAstVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppAstVisitor.java
index c0947f3..ec17484 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppAstVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppAstVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.sqlpp.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.visitor.base.AbstractAstVisitor;
 import org.apache.asterix.lang.sqlpp.clause.FromClause;
 import org.apache.asterix.lang.sqlpp.clause.FromTerm;
@@ -42,77 +42,77 @@ import org.apache.asterix.lang.sqlpp.expression.SelectExpression;
 public abstract class AbstractSqlppAstVisitor<R, T> extends AbstractAstVisitor<R, T> implements ISqlppVisitor<R, T> {
 
     @Override
-    public R visit(FromClause fromClause, T arg) throws AsterixException {
+    public R visit(FromClause fromClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(FromTerm fromTerm, T arg) throws AsterixException {
+    public R visit(FromTerm fromTerm, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(JoinClause joinClause, T arg) throws AsterixException {
+    public R visit(JoinClause joinClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(NestClause nestClause, T arg) throws AsterixException {
+    public R visit(NestClause nestClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(Projection projection, T arg) throws AsterixException {
+    public R visit(Projection projection, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SelectBlock selectBlock, T arg) throws AsterixException {
+    public R visit(SelectBlock selectBlock, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SelectClause selectClause, T arg) throws AsterixException {
+    public R visit(SelectClause selectClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SelectElement selectElement, T arg) throws AsterixException {
+    public R visit(SelectElement selectElement, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SelectRegular selectRegular, T arg) throws AsterixException {
+    public R visit(SelectRegular selectRegular, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SelectSetOperation selectSetOperation, T arg) throws AsterixException {
+    public R visit(SelectSetOperation selectSetOperation, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SelectExpression selectStatement, T arg) throws AsterixException {
+    public R visit(SelectExpression selectStatement, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(UnnestClause unnestClause, T arg) throws AsterixException {
+    public R visit(UnnestClause unnestClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(HavingClause havingClause, T arg) throws AsterixException {
+    public R visit(HavingClause havingClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(IndependentSubquery independentSubquery, T arg) throws AsterixException {
+    public R visit(IndependentSubquery independentSubquery, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CaseExpression caseExpr, T arg) throws AsterixException {
+    public R visit(CaseExpression caseExpr, T arg) throws CompilationException {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppExpressionScopingVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppExpressionScopingVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppExpressionScopingVisitor.java
index c289ebe..96c5987 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppExpressionScopingVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppExpressionScopingVisitor.java
@@ -22,10 +22,10 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.ILangExpression;
@@ -58,8 +58,8 @@ import org.apache.asterix.lang.sqlpp.expression.IndependentSubquery;
 import org.apache.asterix.lang.sqlpp.expression.SelectExpression;
 import org.apache.asterix.lang.sqlpp.struct.SetOperationRight;
 import org.apache.asterix.lang.sqlpp.util.SqlppVariableUtil;
-import org.apache.hyracks.algebricks.common.utils.Pair;
 import org.apache.asterix.metadata.utils.MetadataConstants;
+import org.apache.hyracks.algebricks.common.utils.Pair;
 import org.apache.hyracks.algebricks.core.algebra.base.Counter;
 import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
 
@@ -80,7 +80,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(FromClause fromClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(FromClause fromClause, ILangExpression arg) throws CompilationException {
         Scope scopeForFromClause = scopeChecker.extendCurrentScope();
         for (FromTerm fromTerm : fromClause.getFromTerms()) {
             fromTerm.accept(this, fromClause);
@@ -93,7 +93,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(FromTerm fromTerm, ILangExpression arg) throws AsterixException {
+    public Expression visit(FromTerm fromTerm, ILangExpression arg) throws CompilationException {
         scopeChecker.createNewScope();
         // Visit the left expression of a from term.
         fromTerm.setLeftExpression(visit(fromTerm.getLeftExpression(), fromTerm));
@@ -115,7 +115,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(JoinClause joinClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(JoinClause joinClause, ILangExpression arg) throws CompilationException {
         Scope leftScope = scopeChecker.removeCurrentScope();
         scopeChecker.createNewScope();
         // NOTE: the two join branches cannot be correlated, instead of checking
@@ -143,7 +143,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(NestClause nestClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(NestClause nestClause, ILangExpression arg) throws CompilationException {
         // NOTE: the two branches of a NEST cannot be correlated, instead of
         // checking the correlation here, we defer the check to the query
         // optimizer.
@@ -166,7 +166,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(UnnestClause unnestClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(UnnestClause unnestClause, ILangExpression arg) throws CompilationException {
         unnestClause.setRightExpression(visit(unnestClause.getRightExpression(), unnestClause));
 
         // register the data item variable
@@ -182,7 +182,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(SelectSetOperation selectSetOperation, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectSetOperation selectSetOperation, ILangExpression arg) throws CompilationException {
         Scope scopeBeforeCurrentBranch = scopeChecker.getCurrentScope();
         scopeChecker.createNewScope();
         selectSetOperation.getLeftInput().accept(this, arg);
@@ -204,7 +204,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(Query q, ILangExpression arg) throws AsterixException {
+    public Expression visit(Query q, ILangExpression arg) throws CompilationException {
         q.setBody(visit(q.getBody(), q));
         q.setVarCounter(scopeChecker.getVarCounter());
         context.setVarCounter(scopeChecker.getVarCounter());
@@ -212,7 +212,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(FunctionDecl fd, ILangExpression arg) throws AsterixException {
+    public Expression visit(FunctionDecl fd, ILangExpression arg) throws CompilationException {
         scopeChecker.createNewScope();
         fd.setFuncBody(visit(fd.getFuncBody(), fd));
         scopeChecker.removeCurrentScope();
@@ -220,7 +220,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(GroupbyClause gc, ILangExpression arg) throws AsterixException {
+    public Expression visit(GroupbyClause gc, ILangExpression arg) throws CompilationException {
         // After a GROUP BY, variables defined before the current SELECT BLOCK (e.g., in a WITH clause
         // or an outer scope query) should still be visible.
         Scope newScope = new Scope(scopeChecker, scopeChecker.getCurrentScope().getParentScope());
@@ -266,7 +266,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(LimitClause limitClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(LimitClause limitClause, ILangExpression arg) throws CompilationException {
         scopeChecker.pushForbiddenScope(scopeChecker.getCurrentScope());
         limitClause.setLimitExpr(visit(limitClause.getLimitExpr(), limitClause));
         if(limitClause.hasOffset()) {
@@ -277,7 +277,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(LetClause letClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(LetClause letClause, ILangExpression arg) throws CompilationException {
         scopeChecker.extendCurrentScope();
         letClause.setBindingExpr(visit(letClause.getBindingExpr(), letClause));
         addNewVarSymbolToScope(scopeChecker.getCurrentScope(), letClause.getVarExpr().getVar());
@@ -285,7 +285,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(SelectExpression selectExpression, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectExpression selectExpression, ILangExpression arg) throws CompilationException {
         Scope scopeBeforeSelectExpression = scopeChecker.getCurrentScope();
         scopeChecker.createNewScope();
 
@@ -320,7 +320,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(IndependentSubquery independentSubquery, ILangExpression arg) throws AsterixException {
+    public Expression visit(IndependentSubquery independentSubquery, ILangExpression arg) throws CompilationException {
         // Masks parent scopes so as that the subquery is independent of the environment.
         // In this way, free variables defined in the subquery will not be resolved using
         // variables defined in the parent scope.
@@ -332,7 +332,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(QuantifiedExpression qe, ILangExpression arg) throws AsterixException {
+    public Expression visit(QuantifiedExpression qe, ILangExpression arg) throws CompilationException {
         scopeChecker.createNewScope();
         for (QuantifiedPair pair : qe.getQuantifiedList()) {
             pair.setExpr(visit(pair.getExpr(), qe));
@@ -344,10 +344,10 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(VariableExpr varExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(VariableExpr varExpr, ILangExpression arg) throws CompilationException {
         String varName = varExpr.getVar().getValue();
         if (scopeChecker.isInForbiddenScopes(varName)) {
-            throw new AsterixException(
+            throw new CompilationException(
                     "Inside limit clauses, it is disallowed to reference a variable having the same name as any variable bound in the same scope as the limit clause.");
         }
         Identifier ident = scopeChecker.lookupSymbol(varName);
@@ -361,7 +361,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     @Override
-    public Expression visit(InsertStatement insertStatement, ILangExpression arg) throws AsterixException {
+    public Expression visit(InsertStatement insertStatement, ILangExpression arg) throws CompilationException {
         scopeChecker.createNewScope();
 
         // Visits the body query.
@@ -383,7 +383,7 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
 
     // Rewrites for an undefined variable reference, which potentially could be a syntatic sugar.
     protected Expression wrapWithResolveFunction(VariableExpr expr, Set<VariableExpr> liveVars)
-            throws AsterixException {
+            throws CompilationException {
         List<Expression> argList = new ArrayList<>();
         //Ignore the parser-generated prefix "$" for a dataset.
         String varName = SqlppVariableUtil.toUserDefinedVariableName(expr.getVar().getValue()).getValue();
@@ -393,20 +393,21 @@ public class AbstractSqlppExpressionScopingVisitor extends AbstractSqlppSimpleEx
     }
 
     // Adds a new encountered alias identifier into a scope
-    private void addNewVarSymbolToScope(Scope scope, VarIdentifier var) throws AsterixException {
+    private void addNewVarSymbolToScope(Scope scope, VarIdentifier var) throws CompilationException {
         if (scope.findLocalSymbol(var.getValue()) != null) {
-            throw new AsterixException("Duplicate alias definitions: "
+            throw new CompilationException("Duplicate alias definitions: "
                     + SqlppVariableUtil.toUserDefinedName(var.getValue()));
         }
         scope.addNewVarSymbolToScope(var);
     }
 
     // Merges <code>scopeToBeMerged</code> into <code>hostScope</code>.
-    private void mergeScopes(Scope hostScope, Scope scopeToBeMerged) throws AsterixException {
+    private void mergeScopes(Scope hostScope, Scope scopeToBeMerged) throws CompilationException {
         Set<String> symbolsToBeMerged = scopeToBeMerged.getLocalSymbols();
         for (String symbolToBeMerged : symbolsToBeMerged) {
             if (hostScope.findLocalSymbol(symbolToBeMerged) != null) {
-                throw new AsterixException("Duplicate alias definitions: "
+                throw new CompilationException(
+                        "Duplicate alias definitions: "
                         + SqlppVariableUtil.toUserDefinedName(symbolToBeMerged));
             }
         }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
index f788aea..d754702 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
@@ -21,7 +21,7 @@ package org.apache.asterix.lang.sqlpp.visitor.base;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.ILangExpression;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
@@ -68,7 +68,7 @@ public class AbstractSqlppSimpleExpressionVisitor
         extends AbstractSqlppQueryExpressionVisitor<Expression, ILangExpression> {
 
     @Override
-    public Expression visit(FromClause fromClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(FromClause fromClause, ILangExpression arg) throws CompilationException {
         for (FromTerm fromTerm : fromClause.getFromTerms()) {
             visit(fromTerm, arg);
         }
@@ -76,7 +76,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(FromTerm fromTerm, ILangExpression arg) throws AsterixException {
+    public Expression visit(FromTerm fromTerm, ILangExpression arg) throws CompilationException {
         // Visit the left expression of a from term.
         fromTerm.setLeftExpression(visit(fromTerm.getLeftExpression(), arg));
 
@@ -88,27 +88,27 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(JoinClause joinClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(JoinClause joinClause, ILangExpression arg) throws CompilationException {
         joinClause.setRightExpression(visit(joinClause.getRightExpression(), arg));
         joinClause.setConditionExpression(visit(joinClause.getConditionExpression(), arg));
         return null;
     }
 
     @Override
-    public Expression visit(NestClause nestClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(NestClause nestClause, ILangExpression arg) throws CompilationException {
         nestClause.setRightExpression(visit(nestClause.getRightExpression(), arg));
         nestClause.setConditionExpression(visit(nestClause.getConditionExpression(), arg));
         return null;
     }
 
     @Override
-    public Expression visit(UnnestClause unnestClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(UnnestClause unnestClause, ILangExpression arg) throws CompilationException {
         unnestClause.setRightExpression(visit(unnestClause.getRightExpression(), arg));
         return null;
     }
 
     @Override
-    public Expression visit(Projection projection, ILangExpression arg) throws AsterixException {
+    public Expression visit(Projection projection, ILangExpression arg) throws CompilationException {
         if (!projection.star()) {
             projection.setExpression(visit(projection.getExpression(), arg));
         }
@@ -116,7 +116,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(SelectBlock selectBlock, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectBlock selectBlock, ILangExpression arg) throws CompilationException {
         // Traverses the select block in the order of "from", "let"s, "where",
         // "group by", "let"s, "having" and "select".
         if (selectBlock.hasFromClause()) {
@@ -148,7 +148,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(SelectClause selectClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectClause selectClause, ILangExpression arg) throws CompilationException {
         if (selectClause.selectElement()) {
             selectClause.getSelectElement().accept(this, selectClause);
         }
@@ -159,13 +159,13 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(SelectElement selectElement, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectElement selectElement, ILangExpression arg) throws CompilationException {
         selectElement.setExpression(visit(selectElement.getExpression(), selectElement));
         return null;
     }
 
     @Override
-    public Expression visit(SelectRegular selectRegular, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectRegular selectRegular, ILangExpression arg) throws CompilationException {
         for (Projection projection : selectRegular.getProjections()) {
             projection.accept(this, arg);
         }
@@ -173,7 +173,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(SelectSetOperation selectSetOperation, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectSetOperation selectSetOperation, ILangExpression arg) throws CompilationException {
         selectSetOperation.getLeftInput().accept(this, arg);
         for (SetOperationRight right : selectSetOperation.getRightInputs()) {
             right.getSetOperationRightInput().accept(this, arg);
@@ -182,37 +182,37 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(HavingClause havingClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(HavingClause havingClause, ILangExpression arg) throws CompilationException {
         havingClause.setFilterExpression(visit(havingClause.getFilterExpression(), havingClause));
         return null;
     }
 
     @Override
-    public Expression visit(Query q, ILangExpression arg) throws AsterixException {
+    public Expression visit(Query q, ILangExpression arg) throws CompilationException {
         q.setBody(visit(q.getBody(), q));
         return null;
     }
 
     @Override
-    public Expression visit(FunctionDecl fd, ILangExpression arg) throws AsterixException {
+    public Expression visit(FunctionDecl fd, ILangExpression arg) throws CompilationException {
         fd.setFuncBody(visit(fd.getFuncBody(), fd));
         return null;
     }
 
     @Override
-    public Expression visit(WhereClause whereClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(WhereClause whereClause, ILangExpression arg) throws CompilationException {
         whereClause.setWhereExpr(visit(whereClause.getWhereExpr(), whereClause));
         return null;
     }
 
     @Override
-    public Expression visit(OrderbyClause oc, ILangExpression arg) throws AsterixException {
+    public Expression visit(OrderbyClause oc, ILangExpression arg) throws CompilationException {
         oc.setOrderbyList(visit(oc.getOrderbyList(), arg));
         return null;
     }
 
     @Override
-    public Expression visit(GroupbyClause gc, ILangExpression arg) throws AsterixException {
+    public Expression visit(GroupbyClause gc, ILangExpression arg) throws CompilationException {
         for (GbyVariableExpressionPair gbyVarExpr : gc.getGbyPairList()) {
             gbyVarExpr.setExpr(visit(gbyVarExpr.getExpr(), gc));
         }
@@ -220,7 +220,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(LimitClause limitClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(LimitClause limitClause, ILangExpression arg) throws CompilationException {
         limitClause.setLimitExpr(visit(limitClause.getLimitExpr(), limitClause));
         if (limitClause.hasOffset()) {
             limitClause.setOffset(visit(limitClause.getOffset(), limitClause));
@@ -229,13 +229,13 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(LetClause letClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(LetClause letClause, ILangExpression arg) throws CompilationException {
         letClause.setBindingExpr(visit(letClause.getBindingExpr(), letClause));
         return null;
     }
 
     @Override
-    public Expression visit(SelectExpression selectExpression, ILangExpression arg) throws AsterixException {
+    public Expression visit(SelectExpression selectExpression, ILangExpression arg) throws CompilationException {
         // visit let list
         if (selectExpression.hasLetClauses()) {
             for (LetClause letClause : selectExpression.getLetList()) {
@@ -259,18 +259,18 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(LiteralExpr l, ILangExpression arg) throws AsterixException {
+    public Expression visit(LiteralExpr l, ILangExpression arg) throws CompilationException {
         return l;
     }
 
     @Override
-    public Expression visit(ListConstructor lc, ILangExpression arg) throws AsterixException {
+    public Expression visit(ListConstructor lc, ILangExpression arg) throws CompilationException {
         lc.setExprList(visit(lc.getExprList(), arg));
         return lc;
     }
 
     @Override
-    public Expression visit(RecordConstructor rc, ILangExpression arg) throws AsterixException {
+    public Expression visit(RecordConstructor rc, ILangExpression arg) throws CompilationException {
         for (FieldBinding binding : rc.getFbList()) {
             binding.setLeftExpr(visit(binding.getLeftExpr(), rc));
             binding.setRightExpr(visit(binding.getRightExpr(), rc));
@@ -279,13 +279,13 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(OperatorExpr operatorExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(OperatorExpr operatorExpr, ILangExpression arg) throws CompilationException {
         operatorExpr.setExprList(visit(operatorExpr.getExprList(), arg));
         return operatorExpr;
     }
 
     @Override
-    public Expression visit(IfExpr ifExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(IfExpr ifExpr, ILangExpression arg) throws CompilationException {
         ifExpr.setCondExpr(visit(ifExpr.getCondExpr(), ifExpr));
         ifExpr.setThenExpr(visit(ifExpr.getThenExpr(), ifExpr));
         ifExpr.setElseExpr(visit(ifExpr.getElseExpr(), ifExpr));
@@ -293,7 +293,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(QuantifiedExpression qe, ILangExpression arg) throws AsterixException {
+    public Expression visit(QuantifiedExpression qe, ILangExpression arg) throws CompilationException {
         for (QuantifiedPair pair : qe.getQuantifiedList()) {
             pair.setExpr(visit(pair.getExpr(), qe));
         }
@@ -302,30 +302,30 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(CallExpr callExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(CallExpr callExpr, ILangExpression arg) throws CompilationException {
         callExpr.setExprList(visit(callExpr.getExprList(), arg));
         return callExpr;
     }
 
     @Override
-    public Expression visit(VariableExpr varExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(VariableExpr varExpr, ILangExpression arg) throws CompilationException {
         return varExpr;
     }
 
     @Override
-    public Expression visit(UnaryExpr u, ILangExpression arg) throws AsterixException {
+    public Expression visit(UnaryExpr u, ILangExpression arg) throws CompilationException {
         u.setExpr(visit(u.getExpr(), u));
         return u;
     }
 
     @Override
-    public Expression visit(FieldAccessor fa, ILangExpression arg) throws AsterixException {
+    public Expression visit(FieldAccessor fa, ILangExpression arg) throws CompilationException {
         fa.setExpr(visit(fa.getExpr(), fa));
         return fa;
     }
 
     @Override
-    public Expression visit(IndexAccessor ia, ILangExpression arg) throws AsterixException {
+    public Expression visit(IndexAccessor ia, ILangExpression arg) throws CompilationException {
         ia.setExpr(visit(ia.getExpr(), ia));
         if (ia.getIndexExpr() != null) {
             ia.setIndexExpr(visit(ia.getIndexExpr(), arg));
@@ -334,13 +334,13 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(IndependentSubquery independentSubquery, ILangExpression arg) throws AsterixException {
+    public Expression visit(IndependentSubquery independentSubquery, ILangExpression arg) throws CompilationException {
         independentSubquery.setExpr(visit(independentSubquery.getExpr(), arg));
         return independentSubquery;
     }
 
     @Override
-    public Expression visit(CaseExpression caseExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(CaseExpression caseExpr, ILangExpression arg) throws CompilationException {
         caseExpr.setConditionExpr(visit(caseExpr.getConditionExpr(), arg));
         caseExpr.setWhenExprs(visit(caseExpr.getWhenExprs(), arg));
         caseExpr.setThenExprs(visit(caseExpr.getThenExprs(), arg));
@@ -349,7 +349,7 @@ public class AbstractSqlppSimpleExpressionVisitor
     }
 
     @Override
-    public Expression visit(InsertStatement insertStatement, ILangExpression arg) throws AsterixException {
+    public Expression visit(InsertStatement insertStatement, ILangExpression arg) throws CompilationException {
         Expression returnExpr = insertStatement.getReturnExpression();
         if (returnExpr != null) {
             insertStatement.setReturnExpression(visit(returnExpr, arg));
@@ -359,19 +359,19 @@ public class AbstractSqlppSimpleExpressionVisitor
         return null;
     }
 
-    protected Expression visit(Expression expr, ILangExpression arg) throws AsterixException{
+    protected Expression visit(Expression expr, ILangExpression arg) throws CompilationException {
         return postVisit(preVisit(expr).accept(this, arg));
     }
 
-    protected Expression preVisit(Expression expr) throws AsterixException{
+    protected Expression preVisit(Expression expr) throws CompilationException {
         return expr;
     }
 
-    protected Expression postVisit(Expression expr) throws AsterixException {
+    protected Expression postVisit(Expression expr) throws CompilationException {
         return expr;
     }
 
-    private List<Expression> visit(List<Expression> exprs, ILangExpression arg) throws AsterixException {
+    private List<Expression> visit(List<Expression> exprs, ILangExpression arg) throws CompilationException {
         List<Expression> newExprList = new ArrayList<>();
         for (Expression expr : exprs) {
             newExprList.add(visit(expr, arg));

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/ISqlppVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/ISqlppVisitor.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/ISqlppVisitor.java
index 2827e37..639f3b5 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/ISqlppVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/ISqlppVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.sqlpp.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.asterix.lang.sqlpp.clause.FromClause;
 import org.apache.asterix.lang.sqlpp.clause.FromTerm;
@@ -38,33 +38,33 @@ import org.apache.asterix.lang.sqlpp.expression.SelectExpression;
 
 public interface ISqlppVisitor<R, T> extends ILangVisitor<R, T> {
 
-    R visit(FromClause fromClause, T arg) throws AsterixException;
+    R visit(FromClause fromClause, T arg) throws CompilationException;
 
-    R visit(FromTerm fromTerm, T arg) throws AsterixException;
+    R visit(FromTerm fromTerm, T arg) throws CompilationException;
 
-    R visit(JoinClause joinClause, T arg) throws AsterixException;
+    R visit(JoinClause joinClause, T arg) throws CompilationException;
 
-    R visit(NestClause nestClause, T arg) throws AsterixException;
+    R visit(NestClause nestClause, T arg) throws CompilationException;
 
-    R visit(Projection projection, T arg) throws AsterixException;
+    R visit(Projection projection, T arg) throws CompilationException;
 
-    R visit(SelectBlock selectBlock, T arg) throws AsterixException;
+    R visit(SelectBlock selectBlock, T arg) throws CompilationException;
 
-    R visit(SelectClause selectClause, T arg) throws AsterixException;
+    R visit(SelectClause selectClause, T arg) throws CompilationException;
 
-    R visit(SelectElement selectElement, T arg) throws AsterixException;
+    R visit(SelectElement selectElement, T arg) throws CompilationException;
 
-    R visit(SelectRegular selectRegular, T arg) throws AsterixException;
+    R visit(SelectRegular selectRegular, T arg) throws CompilationException;
 
-    R visit(SelectSetOperation selectSetOperation, T arg) throws AsterixException;
+    R visit(SelectSetOperation selectSetOperation, T arg) throws CompilationException;
 
-    R visit(SelectExpression selectStatement, T arg) throws AsterixException;
+    R visit(SelectExpression selectStatement, T arg) throws CompilationException;
 
-    R visit(UnnestClause unnestClause, T arg) throws AsterixException;
+    R visit(UnnestClause unnestClause, T arg) throws CompilationException;
 
-    R visit(HavingClause havingClause, T arg) throws AsterixException;
+    R visit(HavingClause havingClause, T arg) throws CompilationException;
 
-    R visit(IndependentSubquery independentSubquery, T arg) throws AsterixException;
+    R visit(IndependentSubquery independentSubquery, T arg) throws CompilationException;
 
-    R visit(CaseExpression caseExpression, T arg) throws AsterixException;
+    R visit(CaseExpression caseExpression, T arg) throws CompilationException;
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index e08f758..047fcc4 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -45,7 +45,7 @@ import org.apache.asterix.common.annotations.TypeDataGen;
 import org.apache.asterix.common.annotations.UndeclaredFieldsDataGen;
 import org.apache.asterix.common.config.DatasetConfig.DatasetType;
 import org.apache.asterix.common.config.DatasetConfig.IndexType;
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.Literal;
@@ -258,7 +258,7 @@ class SQLPPParser extends ScopeChecker implements IParser {
         super.setInput(s);
     }
 
-    public static void main(String args[]) throws ParseException, TokenMgrError, IOException, FileNotFoundException, AsterixException {
+    public static void main(String args[]) throws ParseException, TokenMgrError, IOException, FileNotFoundException, CompilationException {
         File file = new File(args[0]);
         Reader fis = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
         SQLPPParser parser = new SQLPPParser(fis);
@@ -266,15 +266,15 @@ class SQLPPParser extends ScopeChecker implements IParser {
         //st.accept(new SQLPPPrintVisitor(), 0);
     }
 
-    public List<Statement> parse() throws AsterixException {
+    public List<Statement> parse() throws CompilationException {
         try {
             return Statement();
         } catch (Error e) {
             // this is here as the JavaCharStream that's below the lexer somtimes throws Errors that are not handled
             // by the ANTLR-generated lexer or parser (e.g it does this for invalid backslash u + 4 hex digits escapes)
-            throw new AsterixException(new ParseException(e.getMessage()));
+            throw new CompilationException(new ParseException(e.getMessage()));
         } catch (ParseException e) {
-            throw new AsterixException("Syntax error: " + getMessage(e));
+            throw new CompilationException("Syntax error: " + getMessage(e));
         }
     }
 
@@ -1782,7 +1782,7 @@ Expression AndExpr()throws ParseException:
         }
         try{
            op.addOperator(token.image.toLowerCase());
-        } catch (AsterixException e){
+        } catch (CompilationException e){
            throw new ParseException(e.getMessage());
         }
     }
@@ -1855,7 +1855,7 @@ Expression RelExpr()throws ParseException:
           }
           try{
             op.addOperator(operator);
-          } catch (AsterixException e){
+          } catch (CompilationException e){
             throw new ParseException(e.getMessage());
           }
         }
@@ -1906,7 +1906,7 @@ Expression BetweenExpr()throws ParseException:
           }
           try{
             op.addOperator(operator);
-          } catch (AsterixException e){
+          } catch (CompilationException e){
             throw new ParseException(e.getMessage());
           }
         }
@@ -2100,7 +2100,7 @@ Expression UnaryExpr() throws ParseException:
         uexpr = new UnaryExpr();
         try{
             uexpr.setExprType(exprType);
-        } catch (AsterixException e){
+        } catch (CompilationException e){
             throw new ParseException(e.getMessage());
         }
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/test/java/org/apache/asterix/lang/sqlpp/parser/ParserTest.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/test/java/org/apache/asterix/lang/sqlpp/parser/ParserTest.java b/asterixdb/asterix-lang-sqlpp/src/test/java/org/apache/asterix/lang/sqlpp/parser/ParserTest.java
index 27679a9..dbb72c7 100644
--- a/asterixdb/asterix-lang-sqlpp/src/test/java/org/apache/asterix/lang/sqlpp/parser/ParserTest.java
+++ b/asterixdb/asterix-lang-sqlpp/src/test/java/org/apache/asterix/lang/sqlpp/parser/ParserTest.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.sqlpp.parser;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.base.IParser;
 import org.apache.asterix.lang.common.base.IParserFactory;
 import org.junit.Test;
@@ -30,7 +30,7 @@ public class ParserTest {
         IParser parser = factory.createParser(query);
         try {
             parser.parse();
-        } catch (AsterixException e) {
+        } catch (CompilationException e) {
             if (!e.getMessage().contains("Syntax error: In line 3")) {
                 throw new Exception("Unexpected error", e);
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java b/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
index 3d98299..1121287 100644
--- a/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
+++ b/asterixdb/asterix-maven-plugins/asterix-grammar-extension-maven-plugin/src/test/java/org/apache/asterix/lang/extension/EchoStatement.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.extension;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.base.Statement;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
@@ -31,7 +31,7 @@ public class EchoStatement implements Statement {
     }
 
     @Override
-    public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws AsterixException {
+    public <R, T> R accept(ILangVisitor<R, T> visitor, T arg) throws CompilationException {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataException.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataException.java
index 84c908f..0501d48 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataException.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataException.java
@@ -19,9 +19,9 @@
 
 package org.apache.asterix.metadata;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 
-public class MetadataException extends AsterixException {
+public class MetadataException extends CompilationException {
     private static final long serialVersionUID = 1L;
 
     public MetadataException(String message) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
index 61c1aff..26706c6 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/MetadataProvider.java
@@ -25,19 +25,20 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.asterix.common.config.StorageProperties;
 import org.apache.asterix.common.config.DatasetConfig.DatasetType;
 import org.apache.asterix.common.config.DatasetConfig.ExternalFilePendingOp;
 import org.apache.asterix.common.config.DatasetConfig.IndexType;
 import org.apache.asterix.common.config.GlobalConfig;
+import org.apache.asterix.common.config.StorageProperties;
 import org.apache.asterix.common.context.AsterixVirtualBufferCacheProvider;
 import org.apache.asterix.common.context.ITransactionSubsystemProvider;
 import org.apache.asterix.common.context.TransactionSubsystemProvider;
+import org.apache.asterix.common.dataflow.IApplicationContextInfo;
 import org.apache.asterix.common.dataflow.LSMIndexUtil;
 import org.apache.asterix.common.dataflow.LSMInvertedIndexInsertDeleteOperatorDescriptor;
 import org.apache.asterix.common.dataflow.LSMTreeInsertDeleteOperatorDescriptor;
-import org.apache.asterix.common.dataflow.IApplicationContextInfo;
 import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.ioopcallbacks.LSMBTreeIOOperationCallbackFactory;
 import org.apache.asterix.common.ioopcallbacks.LSMBTreeWithBuddyIOOperationCallbackFactory;
 import org.apache.asterix.common.ioopcallbacks.LSMInvertedIndexIOOperationCallbackFactory;
@@ -93,8 +94,8 @@ import org.apache.asterix.runtime.job.listener.JobEventListenerFactory;
 import org.apache.asterix.runtime.operators.LSMInvertedIndexUpsertOperatorDescriptor;
 import org.apache.asterix.runtime.operators.LSMTreeUpsertOperatorDescriptor;
 import org.apache.asterix.runtime.util.AppContextInfo;
-import org.apache.asterix.runtime.util.RuntimeComponentsProvider;
 import org.apache.asterix.runtime.util.ClusterStateManager;
+import org.apache.asterix.runtime.util.RuntimeComponentsProvider;
 import org.apache.asterix.transaction.management.opcallbacks.LockThenSearchOperationCallbackFactory;
 import org.apache.asterix.transaction.management.opcallbacks.PrimaryIndexInstantSearchOperationCallbackFactory;
 import org.apache.asterix.transaction.management.opcallbacks.PrimaryIndexModificationOperationCallbackFactory;
@@ -409,18 +410,18 @@ public class MetadataProvider implements IMetadataProvider<DataSourceId, String>
         return new Pair<>(dataScanner, constraint);
     }
 
-    public IDataFormat getDataFormat(String dataverseName) throws AsterixException {
+    public IDataFormat getDataFormat(String dataverseName) throws CompilationException {
         Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverseName);
         IDataFormat format;
         try {
             format = (IDataFormat) Class.forName(dataverse.getDataFormat()).newInstance();
         } catch (Exception e) {
-            throw new AsterixException(e);
+            throw new CompilationException(e);
         }
         return format;
     }
 
-    public Dataverse findDataverse(String dataverseName) throws AsterixException {
+    public Dataverse findDataverse(String dataverseName) throws CompilationException {
         return MetadataManager.INSTANCE.getDataverse(mdTxnCtx, dataverseName);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
index 12e854d..21db749 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/feeds/FeedMetadataUtil.java
@@ -32,6 +32,7 @@ import org.apache.asterix.common.config.DatasetConfig.DatasetType;
 import org.apache.asterix.common.dataflow.LSMTreeInsertDeleteOperatorDescriptor;
 import org.apache.asterix.common.exceptions.ACIDException;
 import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.common.functions.FunctionSignature;
 import org.apache.asterix.common.library.ILibraryManager;
 import org.apache.asterix.external.api.IAdapterFactory;
@@ -93,36 +94,37 @@ public class FeedMetadataUtil {
     private static final Logger LOGGER = Logger.getLogger(FeedMetadataUtil.class.getName());
 
     public static Dataset validateIfDatasetExists(String dataverse, String datasetName, MetadataTransactionContext ctx)
-            throws AsterixException {
+            throws CompilationException {
         Dataset dataset = MetadataManager.INSTANCE.getDataset(ctx, dataverse, datasetName);
         if (dataset == null) {
-            throw new AsterixException("Unknown target dataset :" + datasetName);
+            throw new CompilationException("Unknown target dataset :" + datasetName);
         }
 
         if (!dataset.getDatasetType().equals(DatasetType.INTERNAL)) {
-            throw new AsterixException("Statement not applicable. Dataset " + datasetName + " is not of required type "
+            throw new CompilationException("Statement not applicable. Dataset " + datasetName
+                    + " is not of required type "
                     + DatasetType.INTERNAL);
         }
         return dataset;
     }
 
     public static Feed validateIfFeedExists(String dataverse, String feedName, MetadataTransactionContext ctx)
-            throws AsterixException {
+            throws CompilationException {
         Feed feed = MetadataManager.INSTANCE.getFeed(ctx, dataverse, feedName);
         if (feed == null) {
-            throw new AsterixException("Unknown source feed: " + feedName);
+            throw new CompilationException("Unknown source feed: " + feedName);
         }
         return feed;
     }
 
     public static FeedPolicyEntity validateIfPolicyExists(String dataverse, String policyName,
-            MetadataTransactionContext ctx) throws AsterixException {
+            MetadataTransactionContext ctx) throws CompilationException {
         FeedPolicyEntity feedPolicy = MetadataManager.INSTANCE.getFeedPolicy(ctx, dataverse, policyName);
         if (feedPolicy == null) {
             feedPolicy = MetadataManager.INSTANCE.getFeedPolicy(ctx, MetadataConstants.METADATA_DATAVERSE_NAME,
                     policyName);
             if (feedPolicy == null) {
-                throw new AsterixException("Unknown feed policy" + policyName);
+                throw new CompilationException("Unknown feed policy" + policyName);
             }
         }
         return feedPolicy;


Mime
View raw message