asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjaco...@apache.org
Subject [4/7] asterixdb git commit: Change the compilation related Exception
Date Mon, 16 Jan 2017 18:46:48 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/AbstractInlineUdfsVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/AbstractInlineUdfsVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/AbstractInlineUdfsVisitor.java
index 725d7f4..858a8c2 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/AbstractInlineUdfsVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/AbstractInlineUdfsVisitor.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
-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.Expression.Kind;
@@ -84,17 +84,17 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
      * @return a query expression which is upto a specific langauge, e.g., FLWOGR in AQL and expression query in SQL++.
      */
     protected abstract Expression generateQueryExpression(List<LetClause> letClauses, Expression returnExpr)
-            throws AsterixException;
+            throws CompilationException;
 
     @Override
-    public Boolean visit(Query q, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(Query q, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p = inlineUdfsInExpr(q.getBody(), arg);
         q.setBody(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(FunctionDecl fd, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(FunctionDecl fd, List<FunctionDecl> arg) throws CompilationException {
         // Careful, we should only do this after analyzing the graph of function
         // calls.
         Pair<Boolean, Expression> p = inlineUdfsInExpr(fd.getFuncBody(), arg);
@@ -103,14 +103,14 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     @Override
-    public Boolean visit(ListConstructor lc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(ListConstructor lc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, List<Expression>> p = inlineUdfsInExprList(lc.getExprList(), arg);
         lc.setExprList(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(RecordConstructor rc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(RecordConstructor rc, List<FunctionDecl> arg) throws CompilationException {
         boolean changed = false;
         for (FieldBinding b : rc.getFbList()) {
             Pair<Boolean, Expression> leftExprInlined = inlineUdfsInExpr(b.getLeftExpr(), arg);
@@ -124,35 +124,35 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     @Override
-    public Boolean visit(CallExpr pf, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(CallExpr pf, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, List<Expression>> p = inlineUdfsInExprList(pf.getExprList(), arg);
         pf.setExprList(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(OperatorExpr ifbo, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(OperatorExpr ifbo, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, List<Expression>> p = inlineUdfsInExprList(ifbo.getExprList(), arg);
         ifbo.setExprList(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(FieldAccessor fa, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(FieldAccessor fa, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p = inlineUdfsInExpr(fa.getExpr(), arg);
         fa.setExpr(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(IndexAccessor fa, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(IndexAccessor fa, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p = inlineUdfsInExpr(fa.getExpr(), arg);
         fa.setExpr(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(IfExpr ifexpr, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(IfExpr ifexpr, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p1 = inlineUdfsInExpr(ifexpr.getCondExpr(), arg);
         ifexpr.setCondExpr(p1.second);
         Pair<Boolean, Expression> p2 = inlineUdfsInExpr(ifexpr.getThenExpr(), arg);
@@ -163,7 +163,7 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     @Override
-    public Boolean visit(QuantifiedExpression qe, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(QuantifiedExpression qe, List<FunctionDecl> arg) throws CompilationException {
         boolean changed = false;
         for (QuantifiedPair t : qe.getQuantifiedList()) {
             Pair<Boolean, Expression> p = inlineUdfsInExpr(t.getExpr(), arg);
@@ -178,28 +178,28 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     @Override
-    public Boolean visit(LetClause lc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(LetClause lc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p = inlineUdfsInExpr(lc.getBindingExpr(), arg);
         lc.setBindingExpr(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(WhereClause wc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(WhereClause wc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p = inlineUdfsInExpr(wc.getWhereExpr(), arg);
         wc.setWhereExpr(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(OrderbyClause oc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(OrderbyClause oc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, List<Expression>> p = inlineUdfsInExprList(oc.getOrderbyList(), arg);
         oc.setOrderbyList(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(GroupbyClause gc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(GroupbyClause gc, List<FunctionDecl> arg) throws CompilationException {
         boolean changed = false;
         for (GbyVariableExpressionPair p : gc.getGbyPairList()) {
             Pair<Boolean, Expression> be = inlineUdfsInExpr(p.getExpr(), arg);
@@ -219,7 +219,7 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     @Override
-    public Boolean visit(LimitClause lc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(LimitClause lc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p1 = inlineUdfsInExpr(lc.getLimitExpr(), arg);
         lc.setLimitExpr(p1.second);
         boolean changed = p1.first;
@@ -232,22 +232,22 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     @Override
-    public Boolean visit(UnaryExpr u, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(UnaryExpr u, List<FunctionDecl> arg) throws CompilationException {
         return u.getExpr().accept(this, arg);
     }
 
     @Override
-    public Boolean visit(VariableExpr v, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(VariableExpr v, List<FunctionDecl> arg) throws CompilationException {
         return false;
     }
 
     @Override
-    public Boolean visit(LiteralExpr l, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(LiteralExpr l, List<FunctionDecl> arg) throws CompilationException {
         return false;
     }
 
     @Override
-    public Boolean visit(InsertStatement insert, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(InsertStatement insert, List<FunctionDecl> arg) throws CompilationException {
         boolean changed = false;
         Expression returnExpression = insert.getReturnExpression();
         if (returnExpression != null) {
@@ -261,7 +261,7 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     protected Pair<Boolean, Expression> inlineUdfsInExpr(Expression expr, List<FunctionDecl> arg)
-            throws AsterixException {
+            throws CompilationException {
         if (expr.getKind() != Kind.CALL_EXPRESSION) {
             boolean r = expr.accept(this, arg);
             return new Pair<>(r, expr);
@@ -308,7 +308,7 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
     }
 
     protected Pair<Boolean, List<Expression>> inlineUdfsInExprList(List<Expression> exprList, List<FunctionDecl> fds)
-            throws AsterixException {
+            throws CompilationException {
         ArrayList<Expression> newList = new ArrayList<>();
         boolean changed = false;
         for (Expression e : exprList) {
@@ -321,7 +321,7 @@ public abstract class AbstractInlineUdfsVisitor extends AbstractQueryExpressionV
         return new Pair<>(changed, newList);
     }
 
-    protected Expression rewriteFunctionBody(Expression expr) throws AsterixException {
+    protected Expression rewriteFunctionBody(Expression expr) throws CompilationException {
         Query wrappedQuery = new Query(false);
         wrappedQuery.setBody(expr);
         wrappedQuery.setTopLevel(false);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
index 3fdb141..9b419f1 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/CloneAndSubstituteVariablesVisitor.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
-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.Expression.Kind;
 import org.apache.asterix.lang.common.base.ILangExpression;
@@ -68,7 +68,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(LetClause lc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = lc.getBindingExpr().accept(this, env);
         VariableExpr varExpr = lc.getVarExpr();
         VariableExpr newVe = generateNewVariable(context, varExpr);
@@ -78,7 +78,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(GroupbyClause gc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         VariableSubstitutionEnvironment newSubs = env;
         List<GbyVariableExpressionPair> newGbyList =
                 VariableCloneAndSubstitutionUtil.substInVarExprPair(context, gc.getGbyPairList(), newSubs, this);
@@ -112,7 +112,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(QuantifiedExpression qe,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<QuantifiedPair> oldPairs = qe.getQuantifiedList();
         List<QuantifiedPair> newPairs = new ArrayList<>(oldPairs.size());
         VariableSubstitutionEnvironment newSubs = env;
@@ -131,7 +131,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(WhereClause wc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = wc.getWhereExpr().accept(this, env);
         WhereClause newW = new WhereClause((Expression) p1.first);
         return new Pair<>(newW, p1.second);
@@ -139,7 +139,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(CallExpr pf,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Expression> exprList = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(pf.getExprList(), env, this);
         CallExpr f = new CallExpr(pf.getFunctionSignature(), exprList);
         return new Pair<>(f, env);
@@ -147,16 +147,17 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(FunctionDecl fd,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<VarIdentifier> newList = new ArrayList<>(fd.getParamList().size());
         for (VarIdentifier vi : fd.getParamList()) {
             VariableExpr varExpr = new VariableExpr(vi);
             if (!env.constainsOldVar(varExpr)) {
-                throw new AsterixException("Parameter " + vi + " does not appear in the substitution list.");
+                throw new CompilationException("Parameter " + vi + " does not appear in the substitution list.");
             }
             Expression newExpr = env.findSubstitution(varExpr);
             if (newExpr.getKind() != Kind.VARIABLE_EXPRESSION) {
-                throw new AsterixException("Parameter " + vi + " cannot be substituted by a non-variable expression.");
+                throw new CompilationException(
+                        "Parameter " + vi + " cannot be substituted by a non-variable expression.");
             }
             newList.add(((VariableExpr) newExpr).getVar());
         }
@@ -168,7 +169,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(IfExpr ifexpr,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = ifexpr.getCondExpr().accept(this, env);
         Pair<ILangExpression, VariableSubstitutionEnvironment> p2 = ifexpr.getThenExpr().accept(this, env);
         Pair<ILangExpression, VariableSubstitutionEnvironment> p3 = ifexpr.getElseExpr().accept(this, env);
@@ -178,7 +179,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(LimitClause lc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = lc.getLimitExpr().accept(this, env);
         Pair<ILangExpression, VariableSubstitutionEnvironment> p2;
         Expression lcOffsetExpr = lc.getOffset();
@@ -193,7 +194,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(ListConstructor lc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Expression> oldExprList = lc.getExprList();
         List<Expression> exprs = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(oldExprList, env, this);
         ListConstructor c = new ListConstructor(lc.getType(), exprs);
@@ -202,13 +203,13 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(LiteralExpr l,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         return new Pair<>(l, env);
     }
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(OperatorExpr op,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Expression> oldExprList = op.getExprList();
         List<Expression> exprs = new ArrayList<>(oldExprList.size());
         for (Expression e : oldExprList) {
@@ -221,7 +222,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(OrderbyClause oc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Expression> exprList =
                 VariableCloneAndSubstitutionUtil.visitAndCloneExprList(oc.getOrderbyList(), env, this);
         OrderbyClause oc2 = new OrderbyClause(exprList, oc.getModifierList());
@@ -233,7 +234,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(Query q, VariableSubstitutionEnvironment env)
-            throws AsterixException {
+            throws CompilationException {
         Query newQ = new Query(q.isExplain());
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = q.getBody().accept(this, env);
         newQ.setBody((Expression) p1.first);
@@ -242,7 +243,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(RecordConstructor rc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<FieldBinding> oldFbs = rc.getFbList();
         ArrayList<FieldBinding> newFbs = new ArrayList<>(oldFbs.size());
         for (FieldBinding fb : oldFbs) {
@@ -257,7 +258,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(UnaryExpr u,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = u.getExpr().accept(this, env);
         UnaryExpr newU = new UnaryExpr(u.getExprType(), (Expression) p1.first);
         return new Pair<>(newU, env);
@@ -265,7 +266,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(IndexAccessor ia,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = ia.getExpr().accept(this, env);
         Expression indexExpr = null;
         if (!ia.isAny()) {
@@ -279,7 +280,7 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(FieldAccessor fa,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p = fa.getExpr().accept(this, env);
         FieldAccessor newF = new FieldAccessor((Expression) p.first, fa.getIdent());
         return new Pair<>(newF, p.second);
@@ -287,13 +288,13 @@ public class CloneAndSubstituteVariablesVisitor extends
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(VariableExpr v,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         return new Pair<>(rewriteVariableExpr(v, env), env);
     }
 
     // Replace a variable expression if the variable is to-be substituted.
     protected Expression rewriteVariableExpr(VariableExpr expr, VariableSubstitutionEnvironment env)
-            throws AsterixException {
+            throws CompilationException {
         if (env.constainsOldVar(expr)) {
             return env.findSubstitution(expr);
         } else {
@@ -329,10 +330,10 @@ public class CloneAndSubstituteVariablesVisitor extends
      * @param env,
      *            the variable substitution environment.
      * @return a pair of an ILangExpression and a variable substitution environment.
-     * @throws AsterixException
+     * @throws CompilationException
      */
     protected Pair<ILangExpression, VariableSubstitutionEnvironment> visitUnnesBindingExpression(Expression expr,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         return expr.accept(this, env);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
index 7a96fac..eefed9d 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/FormatPrintVisitor.java
@@ -30,7 +30,7 @@ import java.util.Set;
 
 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;
@@ -145,7 +145,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(Query q, Integer step) throws AsterixException {
+    public Void visit(Query q, Integer step) throws CompilationException {
         if (q.getBody() != null) {
             q.getBody().accept(this, step);
         }
@@ -185,7 +185,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(ListConstructor lc, Integer step) throws AsterixException {
+    public Void visit(ListConstructor lc, Integer step) throws CompilationException {
         boolean ordered = false;
         if (lc.getType().equals(ListConstructor.Type.ORDERED_LIST_CONSTRUCTOR)) {
             ordered = true;
@@ -197,7 +197,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(RecordConstructor rc, Integer step) throws AsterixException {
+    public Void visit(RecordConstructor rc, Integer step) throws CompilationException {
         out.print("{");
         // print all field bindings
         int size = rc.getFbList().size();
@@ -215,7 +215,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CallExpr callExpr, Integer step) throws AsterixException {
+    public Void visit(CallExpr callExpr, Integer step) throws CompilationException {
         printHints(callExpr.getHints(), step);
         out.print(generateFullName(callExpr.getFunctionSignature().getNamespace(),
                 callExpr.getFunctionSignature().getName()) + "(");
@@ -225,7 +225,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(OperatorExpr operatorExpr, Integer step) throws AsterixException {
+    public Void visit(OperatorExpr operatorExpr, Integer step) throws CompilationException {
         List<Expression> exprList = operatorExpr.getExprList();
         List<OperatorType> opList = operatorExpr.getOpList();
         if (operatorExpr.isCurrentop()) {
@@ -247,7 +247,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(IfExpr ifexpr, Integer step) throws AsterixException {
+    public Void visit(IfExpr ifexpr, Integer step) throws CompilationException {
         out.print("if (");
         ifexpr.getCondExpr().accept(this, step + 2);
         out.println(")");
@@ -260,7 +260,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(QuantifiedExpression qe, Integer step) throws AsterixException {
+    public Void visit(QuantifiedExpression qe, Integer step) throws CompilationException {
         out.print(qe.getQuantifier().toString().toLowerCase() + " ");
         // quantifiedList accept visitor
         int index = 0;
@@ -279,7 +279,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(LetClause lc, Integer step) throws AsterixException {
+    public Void visit(LetClause lc, Integer step) throws CompilationException {
         out.print(skip(step) + "let ");
         lc.getVarExpr().accept(this, 0);
         out.print(assignSymbol);
@@ -289,7 +289,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(WhereClause wc, Integer step) throws AsterixException {
+    public Void visit(WhereClause wc, Integer step) throws CompilationException {
         out.print(skip(step) + "where ");
         wc.getWhereExpr().accept(this, step + 1);
         out.println();
@@ -297,7 +297,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(OrderbyClause oc, Integer step) throws AsterixException {
+    public Void visit(OrderbyClause oc, Integer step) throws CompilationException {
         out.print(skip(step) + "order by ");
         List<OrderModifier> mlist = oc.getModifierList();
         List<Expression> list = oc.getOrderbyList();
@@ -318,7 +318,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @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 */");
         }
@@ -351,7 +351,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(LimitClause lc, Integer step) throws AsterixException {
+    public Void visit(LimitClause lc, Integer step) throws CompilationException {
         out.print(skip(step) + "limit ");
         lc.getLimitExpr().accept(this, step + 1);
         if (lc.getOffset() != null) {
@@ -363,7 +363,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(FunctionDecl fd, Integer step) throws AsterixException {
+    public Void visit(FunctionDecl fd, Integer step) throws CompilationException {
         out.print(skip(step) + "declare function " + generateFullName(null, fd.getSignature().getName()) + "(");
         List<Identifier> parameters = new ArrayList<Identifier>();
         parameters.addAll(fd.getParamList());
@@ -377,21 +377,21 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(UnaryExpr u, Integer step) throws AsterixException {
+    public Void visit(UnaryExpr u, Integer step) throws CompilationException {
         out.print(u.getExprType() == UnaryExprType.NEGATIVE ? "-" : "");
         u.getExpr().accept(this, 0);
         return null;
     }
 
     @Override
-    public Void visit(FieldAccessor fa, Integer step) throws AsterixException {
+    public Void visit(FieldAccessor fa, Integer step) throws CompilationException {
         fa.getExpr().accept(this, step + 1);
         out.print("." + normalize(fa.getIdent().getValue()));
         return null;
     }
 
     @Override
-    public Void visit(IndexAccessor fa, Integer step) throws AsterixException {
+    public Void visit(IndexAccessor fa, Integer step) throws CompilationException {
         fa.getExpr().accept(this, step + 1);
         out.print("[");
         if (fa.isAny()) {
@@ -404,7 +404,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(TypeDecl t, Integer step) throws AsterixException {
+    public Void visit(TypeDecl t, Integer step) throws CompilationException {
         out.println(skip(step) + "create type " + generateFullName(t.getDataverseName(), t.getIdent())
                 + generateIfNotExists(t.getIfNotExists()) + " as");
         t.getTypeDef().accept(this, step + 1);
@@ -413,7 +413,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(TypeReferenceExpression t, Integer arg) throws AsterixException {
+    public Void visit(TypeReferenceExpression t, Integer arg) throws CompilationException {
         if (t.getIdent().first != null && t.getIdent().first.getValue() != null) {
             out.print(normalize(t.getIdent().first.getValue()));
             out.print('.');
@@ -423,7 +423,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(RecordTypeDefinition r, Integer step) throws AsterixException {
+    public Void visit(RecordTypeDefinition r, Integer step) throws CompilationException {
         if (r.getRecordKind() == RecordKind.CLOSED) {
             out.print(" closed ");
         }
@@ -454,7 +454,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(OrderedListTypeDefinition x, Integer step) throws AsterixException {
+    public Void visit(OrderedListTypeDefinition x, Integer step) throws CompilationException {
         out.print("[");
         x.getItemTypeExpression().accept(this, step + 2);
         out.print("]");
@@ -462,7 +462,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(UnorderedListTypeDefinition x, Integer step) throws AsterixException {
+    public Void visit(UnorderedListTypeDefinition x, Integer step) throws CompilationException {
         out.print("{{");
         x.getItemTypeExpression().accept(this, step + 2);
         out.print("}}");
@@ -470,7 +470,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(DatasetDecl dd, Integer step) throws AsterixException {
+    public Void visit(DatasetDecl dd, Integer step) throws CompilationException {
         if (dd.getDatasetType() == DatasetType.INTERNAL) {
             String temp = dd.getDatasetDetailsDecl().isTemp() ? "temporary" : "";
             out.print(skip(step) + "create " + temp + datasetSymbol + generateFullName(dd.getDataverse(), dd.getName())
@@ -518,13 +518,13 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(DataverseDecl dv, Integer step) throws AsterixException {
+    public Void visit(DataverseDecl dv, Integer step) throws CompilationException {
         out.println(skip(step) + "use " + dataverseSymbol + normalize(dv.getDataverseName().getValue()) + ";\n\n");
         return null;
     }
 
     @Override
-    public Void visit(WriteStatement ws, Integer step) throws AsterixException {
+    public Void visit(WriteStatement ws, Integer step) throws CompilationException {
         out.print(skip(step) + "write output to " + ws.getNcName() + ":" + revertStringToQuoted(ws.getFileName()));
         if (ws.getWriterClassName() != null) {
             out.print(" using " + ws.getWriterClassName());
@@ -534,21 +534,21 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(SetStatement ss, Integer step) throws AsterixException {
+    public Void visit(SetStatement ss, Integer step) throws CompilationException {
         out.println(skip(step) + "set " + revertStringToQuoted(ss.getPropName()) + " "
                 + revertStringToQuoted(ss.getPropValue()) + ";\n");
         return null;
     }
 
     @Override
-    public Void visit(DisconnectFeedStatement ss, Integer step) throws AsterixException {
+    public Void visit(DisconnectFeedStatement ss, Integer step) throws CompilationException {
         out.println(skip(step) + "disconnect " + FEED + generateFullName(ss.getDataverseName(), ss.getFeedName())
                 + " from " + datasetSymbol + generateFullName(ss.getDataverseName(), ss.getDatasetName()) + ";");
         return null;
     }
 
     @Override
-    public Void visit(NodegroupDecl ngd, Integer step) throws AsterixException {
+    public Void visit(NodegroupDecl ngd, Integer step) throws CompilationException {
         out.println(
                 CREATE + " nodegroup " + ngd.getNodegroupName() + generateIfNotExists(ngd.getIfNotExists()) + " on ");
         out.print(skip(step + 2));
@@ -559,7 +559,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(LoadStatement stmtLoad, Integer step) throws AsterixException {
+    public Void visit(LoadStatement stmtLoad, Integer step) throws CompilationException {
         out.print(skip(step) + "load " + datasetSymbol
                 + generateFullName(stmtLoad.getDataverseName(), stmtLoad.getDatasetName()) + " using "
                 + revertStringToQuoted(stmtLoad.getAdapter()) + " ");
@@ -570,7 +570,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(DropDatasetStatement del, Integer step) throws AsterixException {
+    public Void visit(DropDatasetStatement del, Integer step) throws CompilationException {
         out.println(
                 skip(step) + "drop " + datasetSymbol + generateFullName(del.getDataverseName(), del.getDatasetName())
                         + generateIfExists(del.getIfExists()) + SEMICOLON);
@@ -578,7 +578,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @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()));
         out.print("(");
@@ -589,7 +589,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(DeleteStatement del, Integer step) throws AsterixException {
+    public Void visit(DeleteStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "delete ");
         del.getVariableExpr().accept(this, step + 2);
         out.println(
@@ -603,7 +603,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(UpdateStatement update, Integer step) throws AsterixException {
+    public Void visit(UpdateStatement update, Integer step) throws CompilationException {
         out.println(skip(step) + "update ");
         update.getVariableExpr().accept(this, step + 2);
         out.print(" in ");
@@ -623,7 +623,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(UpdateClause del, Integer step) throws AsterixException {
+    public Void visit(UpdateClause del, Integer step) throws CompilationException {
         if (del.hasSet()) {
             out.println(skip(step) + "set ");
             del.getTarget().accept(this, step + 2);
@@ -654,7 +654,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CreateIndexStatement cis, Integer step) throws AsterixException {
+    public Void visit(CreateIndexStatement cis, Integer step) throws CompilationException {
         out.print(skip(step) + CREATE + " index ");
         out.print(normalize(cis.getIndexName().getValue()) + " ");
         out.print(generateIfNotExists(cis.getIfNotExists()));
@@ -691,7 +691,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CreateDataverseStatement del, Integer step) throws AsterixException {
+    public Void visit(CreateDataverseStatement del, Integer step) throws CompilationException {
         out.print(CREATE + dataverseSymbol);
         out.print(normalize(del.getDataverseName().getValue()));
         out.print(generateIfNotExists(del.getIfNotExists()));
@@ -706,7 +706,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(IndexDropStatement del, Integer step) throws AsterixException {
+    public Void visit(IndexDropStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "drop index ");
         out.print(generateFullName(del.getDataverseName(), del.getDatasetName()));
         out.print("." + del.getIndexName());
@@ -715,7 +715,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(NodeGroupDropStatement del, Integer step) throws AsterixException {
+    public Void visit(NodeGroupDropStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "drop nodegroup ");
         out.print(del.getNodeGroupName());
         out.println(generateIfExists(del.getIfExists()) + SEMICOLON);
@@ -723,7 +723,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(DataverseDropStatement del, Integer step) throws AsterixException {
+    public Void visit(DataverseDropStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "drop " + dataverseSymbol);
         out.print(normalize(del.getDataverseName().getValue()));
         out.println(generateIfExists(del.getIfExists()) + SEMICOLON);
@@ -731,7 +731,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(TypeDropStatement del, Integer step) throws AsterixException {
+    public Void visit(TypeDropStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "drop type ");
         out.print(generateFullName(del.getDataverseName(), del.getTypeName()));
         out.println(generateIfExists(del.getIfExists()) + SEMICOLON);
@@ -739,7 +739,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(ConnectFeedStatement connectFeedStmt, Integer step) throws AsterixException {
+    public Void visit(ConnectFeedStatement connectFeedStmt, Integer step) throws CompilationException {
         out.print(skip(step) + "connect " + FEED);
         out.print(generateFullName(connectFeedStmt.getDataverseName(), new Identifier(connectFeedStmt.getFeedName())));
         out.print(" to " + datasetSymbol
@@ -752,7 +752,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CreatePrimaryFeedStatement cpfs, Integer step) throws AsterixException {
+    public Void visit(CreatePrimaryFeedStatement cpfs, Integer step) throws CompilationException {
         out.print(skip(step) + CREATE + " primary feed ");
         out.print(generateFullName(cpfs.getDataverseName(), cpfs.getFeedName()));
         out.print(generateIfNotExists(cpfs.getIfNotExists()));
@@ -767,7 +767,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CreateSecondaryFeedStatement csfs, Integer step) throws AsterixException {
+    public Void visit(CreateSecondaryFeedStatement csfs, Integer step) throws CompilationException {
         out.print(skip(step) + CREATE + " secondary feed ");
         out.print(generateFullName(csfs.getDataverseName(), csfs.getFeedName()));
         out.print(generateIfNotExists(csfs.getIfNotExists()));
@@ -781,7 +781,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(FeedDropStatement del, Integer step) throws AsterixException {
+    public Void visit(FeedDropStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "drop " + FEED);
         out.print(generateFullName(del.getDataverseName(), del.getFeedName()));
         out.println(generateIfExists(del.getIfExists()) + SEMICOLON);
@@ -789,12 +789,12 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(FeedPolicyDropStatement dfs, Integer step) throws AsterixException {
+    public Void visit(FeedPolicyDropStatement dfs, Integer step) throws CompilationException {
         return null;
     }
 
     @Override
-    public Void visit(CreateFeedPolicyStatement cfps, Integer step) throws AsterixException {
+    public Void visit(CreateFeedPolicyStatement cfps, Integer step) throws CompilationException {
         out.print(skip(step) + CREATE + "ingestion policy ");
         out.print(cfps.getPolicyName());
         out.print(generateIfNotExists(cfps.getIfNotExists()));
@@ -820,7 +820,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CreateFunctionStatement cfs, Integer step) throws AsterixException {
+    public Void visit(CreateFunctionStatement cfs, Integer step) throws CompilationException {
         out.print(skip(step) + CREATE + " function ");
         out.print(generateIfNotExists(cfs.getIfNotExists()));
         out.print(this.generateFullName(cfs.getSignature().getNamespace(), cfs.getSignature().getName()));
@@ -834,7 +834,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(FunctionDropStatement del, Integer step) throws AsterixException {
+    public Void visit(FunctionDropStatement del, Integer step) throws CompilationException {
         out.print(skip(step) + "drop function ");
         FunctionSignature funcSignature = del.getFunctionSignature();
         out.print(funcSignature.toString());
@@ -843,7 +843,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     @Override
-    public Void visit(CompactStatement del, Integer step) throws AsterixException {
+    public Void visit(CompactStatement del, Integer step) throws CompilationException {
         return null;
     }
 
@@ -883,7 +883,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     protected void printDelimitedGbyExpressions(List<GbyVariableExpressionPair> gbyList, int step)
-            throws AsterixException {
+            throws CompilationException {
         int gbySize = gbyList.size();
         int gbyIndex = 0;
         for (GbyVariableExpressionPair pair : gbyList) {
@@ -899,7 +899,7 @@ public class FormatPrintVisitor implements ILangVisitor<Void, Integer> {
     }
 
     protected void printDelimitedExpressions(List<? extends Expression> exprs, String delimiter, int step)
-            throws AsterixException {
+            throws CompilationException {
         int index = 0;
         int size = exprs.size();
         for (Expression expr : exprs) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/GatherFunctionCallsVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/GatherFunctionCallsVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/GatherFunctionCallsVisitor.java
index 12c95bb..8842d86 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/GatherFunctionCallsVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/GatherFunctionCallsVisitor.java
@@ -22,7 +22,7 @@ package org.apache.asterix.lang.common.visitor;
 import java.util.HashSet;
 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.clause.GroupbyClause;
@@ -56,7 +56,7 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     protected final Set<FunctionSignature> calls = new HashSet<FunctionSignature>();
 
     @Override
-    public Void visit(CallExpr pf, Void arg) throws AsterixException {
+    public Void visit(CallExpr pf, Void arg) throws CompilationException {
         calls.add(pf.getFunctionSignature());
         for (Expression e : pf.getExprList()) {
             e.accept(this, arg);
@@ -65,13 +65,13 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(FieldAccessor fa, Void arg) throws AsterixException {
+    public Void visit(FieldAccessor fa, Void arg) throws CompilationException {
         fa.getExpr().accept(this, arg);
         return null;
     }
 
     @Override
-    public Void visit(GroupbyClause gc, Void arg) throws AsterixException {
+    public Void visit(GroupbyClause gc, Void arg) throws CompilationException {
         for (GbyVariableExpressionPair p : gc.getGbyPairList()) {
             p.getExpr().accept(this, arg);
         }
@@ -82,7 +82,7 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(IfExpr ifexpr, Void arg) throws AsterixException {
+    public Void visit(IfExpr ifexpr, Void arg) throws CompilationException {
         ifexpr.getCondExpr().accept(this, arg);
         ifexpr.getThenExpr().accept(this, arg);
         ifexpr.getElseExpr().accept(this, arg);
@@ -90,19 +90,19 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(IndexAccessor ia, Void arg) throws AsterixException {
+    public Void visit(IndexAccessor ia, Void arg) throws CompilationException {
         ia.getExpr().accept(this, arg);
         return null;
     }
 
     @Override
-    public Void visit(LetClause lc, Void arg) throws AsterixException {
+    public Void visit(LetClause lc, Void arg) throws CompilationException {
         lc.getBindingExpr().accept(this, arg);
         return null;
     }
 
     @Override
-    public Void visit(LimitClause lc, Void arg) throws AsterixException {
+    public Void visit(LimitClause lc, Void arg) throws CompilationException {
         lc.getLimitExpr().accept(this, arg);
         if (lc.getOffset() != null) {
             lc.getOffset().accept(this, arg);
@@ -111,7 +111,7 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(ListConstructor lc, Void arg) throws AsterixException {
+    public Void visit(ListConstructor lc, Void arg) throws CompilationException {
         for (Expression e : lc.getExprList()) {
             e.accept(this, arg);
         }
@@ -119,13 +119,13 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(LiteralExpr l, Void arg) throws AsterixException {
+    public Void visit(LiteralExpr l, Void arg) throws CompilationException {
         // do nothing
         return null;
     }
 
     @Override
-    public Void visit(OperatorExpr op, Void arg) throws AsterixException {
+    public Void visit(OperatorExpr op, Void arg) throws CompilationException {
         for (Expression e : op.getExprList()) {
             e.accept(this, arg);
         }
@@ -133,7 +133,7 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(OrderbyClause oc, Void arg) throws AsterixException {
+    public Void visit(OrderbyClause oc, Void arg) throws CompilationException {
         for (Expression e : oc.getOrderbyList()) {
             e.accept(this, arg);
         }
@@ -141,12 +141,12 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(OrderedListTypeDefinition olte, Void arg) throws AsterixException {
+    public Void visit(OrderedListTypeDefinition olte, Void arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public Void visit(QuantifiedExpression qe, Void arg) throws AsterixException {
+    public Void visit(QuantifiedExpression qe, Void arg) throws CompilationException {
         for (QuantifiedPair qp : qe.getQuantifiedList()) {
             qp.getExpr().accept(this, arg);
         }
@@ -155,13 +155,13 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(Query q, Void arg) throws AsterixException {
+    public Void visit(Query q, Void arg) throws CompilationException {
         q.getBody().accept(this, arg);
         return null;
     }
 
     @Override
-    public Void visit(RecordConstructor rc, Void arg) throws AsterixException {
+    public Void visit(RecordConstructor rc, Void arg) throws CompilationException {
         for (FieldBinding fb : rc.getFbList()) {
             fb.getLeftExpr().accept(this, arg);
             fb.getRightExpr().accept(this, arg);
@@ -170,30 +170,30 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(TypeReferenceExpression tre, Void arg) throws AsterixException {
+    public Void visit(TypeReferenceExpression tre, Void arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public Void visit(UnaryExpr u, Void arg) throws AsterixException {
+    public Void visit(UnaryExpr u, Void arg) throws CompilationException {
         u.getExpr().accept(this, arg);
         return null;
     }
 
     @Override
-    public Void visit(VariableExpr v, Void arg) throws AsterixException {
+    public Void visit(VariableExpr v, Void arg) throws CompilationException {
         // do nothing
         return null;
     }
 
     @Override
-    public Void visit(WhereClause wc, Void arg) throws AsterixException {
+    public Void visit(WhereClause wc, Void arg) throws CompilationException {
         wc.getWhereExpr().accept(this, arg);
         return null;
     }
 
     @Override
-    public Void visit(InsertStatement wc, Void arg) throws AsterixException {
+    public Void visit(InsertStatement wc, Void arg) throws CompilationException {
         wc.getQuery().accept(this, arg);
         Expression returnExpression = wc.getReturnExpression();
         if (returnExpression != null) {
@@ -207,7 +207,7 @@ public class GatherFunctionCallsVisitor extends AbstractQueryExpressionVisitor<V
     }
 
     @Override
-    public Void visit(FunctionDecl fd, Void arg) throws AsterixException {
+    public Void visit(FunctionDecl fd, Void arg) throws CompilationException {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
index e7cf43b..5e01321 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/QueryPrintVisitor.java
@@ -24,7 +24,7 @@ import java.util.List;
 import java.util.Map.Entry;
 
 import org.apache.asterix.common.config.DatasetConfig.DatasetType;
-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.Literal;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
@@ -85,7 +85,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(Query q, Integer step) throws AsterixException {
+    public Void visit(Query q, Integer step) throws CompilationException {
         if (q.getBody() != null) {
             out.println("Query:");
             q.getBody().accept(this, step);
@@ -115,7 +115,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(ListConstructor lc, Integer step) throws AsterixException {
+    public Void visit(ListConstructor lc, Integer step) throws CompilationException {
         boolean ordered = false;
         if (lc.getType().equals(ListConstructor.Type.ORDERED_LIST_CONSTRUCTOR)) {
             ordered = true;
@@ -130,7 +130,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(RecordConstructor rc, Integer step) throws AsterixException {
+    public Void visit(RecordConstructor rc, Integer step) throws CompilationException {
         out.println(skip(step) + "RecordConstructor [");
         // fbList accept visitor
         for (FieldBinding fb : rc.getFbList()) {
@@ -145,7 +145,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(CallExpr pf, Integer step) throws AsterixException {
+    public Void visit(CallExpr pf, Integer step) throws CompilationException {
         out.println(skip(step) + "FunctionCall " + pf.getFunctionSignature().toString() + "[");
         for (Expression expr : pf.getExprList()) {
             expr.accept(this, step + 1);
@@ -155,7 +155,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(OperatorExpr ifbo, Integer step) throws AsterixException {
+    public Void visit(OperatorExpr ifbo, Integer step) throws CompilationException {
         List<Expression> exprList = ifbo.getExprList();
         List<OperatorType> opList = ifbo.getOpList();
         if (ifbo.isCurrentop()) {
@@ -173,7 +173,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(IfExpr ifexpr, Integer step) throws AsterixException {
+    public Void visit(IfExpr ifexpr, Integer step) throws CompilationException {
         out.println(skip(step) + "IfExpr [");
         out.println(skip(step + 1) + "Condition:");
         ifexpr.getCondExpr().accept(this, step + 2);
@@ -186,7 +186,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(QuantifiedExpression qe, Integer step) throws AsterixException {
+    public Void visit(QuantifiedExpression qe, Integer step) throws CompilationException {
         out.println(skip(step) + "QuantifiedExpression " + qe.getQuantifier() + " [");
         // quantifiedList accept visitor
         for (QuantifiedPair pair : qe.getQuantifiedList()) {
@@ -204,7 +204,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(LetClause lc, Integer step) throws AsterixException {
+    public Void visit(LetClause lc, Integer step) throws CompilationException {
         out.print(skip(step) + "Let ");
         lc.getVarExpr().accept(this, 0);
         out.println(skip(step + 1) + ":=");
@@ -213,14 +213,14 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(WhereClause wc, Integer step) throws AsterixException {
+    public Void visit(WhereClause wc, Integer step) throws CompilationException {
         out.println(skip(step) + "Where");
         wc.getWhereExpr().accept(this, step + 1);
         return null;
     }
 
     @Override
-    public Void visit(OrderbyClause oc, Integer step) throws AsterixException {
+    public Void visit(OrderbyClause oc, Integer step) throws CompilationException {
         out.println(skip(step) + "Orderby");
         List<OrderModifier> mlist = oc.getModifierList();
         List<Expression> list = oc.getOrderbyList();
@@ -233,7 +233,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(GroupbyClause gc, Integer step) throws AsterixException {
+    public Void visit(GroupbyClause gc, Integer step) throws CompilationException {
         out.println(skip(step) + "Groupby");
         for (GbyVariableExpressionPair pair : gc.getGbyPairList()) {
             if (pair.getVar() != null) {
@@ -269,7 +269,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(LimitClause lc, Integer step) throws AsterixException {
+    public Void visit(LimitClause lc, Integer step) throws CompilationException {
         out.println(skip(step) + "Limit");
         lc.getLimitExpr().accept(this, step + 1);
         if (lc.getOffset() != null) {
@@ -280,7 +280,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(FunctionDecl fd, Integer step) throws AsterixException {
+    public Void visit(FunctionDecl fd, Integer step) throws CompilationException {
         out.println(skip(step) + "FunctionDecl " + fd.getSignature().getName() + "(" + fd.getParamList().toString()
                 + ") {");
         fd.getFuncBody().accept(this, step + 1);
@@ -290,7 +290,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(UnaryExpr u, Integer step) throws AsterixException {
+    public Void visit(UnaryExpr u, Integer step) throws CompilationException {
         if (u.getExprType() != null) {
             out.print(skip(step) + u.getExprType() + " ");
             u.getExpr().accept(this, 0);
@@ -301,7 +301,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(FieldAccessor fa, Integer step) throws AsterixException {
+    public Void visit(FieldAccessor fa, Integer step) throws CompilationException {
         out.println(skip(step) + "FieldAccessor [");
         fa.getExpr().accept(this, step + 1);
         out.println(skip(step + 1) + "Field=" + fa.getIdent().getValue());
@@ -310,7 +310,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(IndexAccessor fa, Integer step) throws AsterixException {
+    public Void visit(IndexAccessor fa, Integer step) throws CompilationException {
         out.println(skip(step) + "IndexAccessor [");
         fa.getExpr().accept(this, step + 1);
         out.print(skip(step + 1) + "Index: ");
@@ -324,7 +324,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(TypeDecl t, Integer step) throws AsterixException {
+    public Void visit(TypeDecl t, Integer step) throws CompilationException {
         out.println(skip(step) + "TypeDecl " + t.getIdent() + " [");
         t.getTypeDef().accept(this, step + 1);
         out.println(skip(step) + "]");
@@ -332,7 +332,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(TypeReferenceExpression t, Integer arg) throws AsterixException {
+    public Void visit(TypeReferenceExpression t, Integer arg) throws CompilationException {
         if (t.getIdent().first != null && t.getIdent().first.getValue() != null) {
             out.print(t.getIdent().first.getValue());
             out.print('.');
@@ -342,7 +342,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(RecordTypeDefinition r, Integer step) throws AsterixException {
+    public Void visit(RecordTypeDefinition r, Integer step) throws CompilationException {
         if (r.getRecordKind() == RecordKind.CLOSED) {
             out.print(skip(step) + "closed ");
         } else {
@@ -374,7 +374,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(OrderedListTypeDefinition x, Integer step) throws AsterixException {
+    public Void visit(OrderedListTypeDefinition x, Integer step) throws CompilationException {
         out.print("OrderedList [");
         x.getItemTypeExpression().accept(this, step + 2);
         out.println("]");
@@ -382,7 +382,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(UnorderedListTypeDefinition x, Integer step) throws AsterixException {
+    public Void visit(UnorderedListTypeDefinition x, Integer step) throws CompilationException {
         out.print("UnorderedList <");
         x.getItemTypeExpression().accept(this, step + 2);
         out.println(">");
@@ -390,7 +390,7 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(DatasetDecl dd, Integer step) throws AsterixException {
+    public Void visit(DatasetDecl dd, Integer step) throws CompilationException {
         if (dd.getDatasetType() == DatasetType.INTERNAL) {
             String line = skip(step) + "DatasetDecl " + dd.getName() + "(" + dd.getItemTypeName() + ")"
                     + " partitioned by " + ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getPartitioningExprs();
@@ -406,13 +406,13 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(DataverseDecl dv, Integer step) throws AsterixException {
+    public Void visit(DataverseDecl dv, Integer step) throws CompilationException {
         out.println(skip(step) + "DataverseUse " + dv.getDataverseName());
         return null;
     }
 
     @Override
-    public Void visit(WriteStatement ws, Integer step) throws AsterixException {
+    public Void visit(WriteStatement ws, Integer step) throws CompilationException {
         out.print(skip(step) + "WriteOutputTo " + ws.getNcName() + ":" + ws.getFileName());
         if (ws.getWriterClassName() != null) {
             out.print(" using " + ws.getWriterClassName());
@@ -422,13 +422,13 @@ public class QueryPrintVisitor extends AbstractQueryExpressionVisitor<Void, Inte
     }
 
     @Override
-    public Void visit(SetStatement ss, Integer step) throws AsterixException {
+    public Void visit(SetStatement ss, Integer step) throws CompilationException {
         out.println(skip(step) + "Set " + ss.getPropName() + "=" + ss.getPropValue());
         return null;
     }
 
     @Override
-    public Void visit(DisconnectFeedStatement ss, Integer step) throws AsterixException {
+    public Void visit(DisconnectFeedStatement ss, Integer step) throws CompilationException {
         out.println(skip(step) + skip(step) + ss.getFeedName() + skip(step) + ss.getDatasetName());
         return null;
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractAstVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractAstVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractAstVisitor.java
index 3f586e9..a422ef1 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractAstVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractAstVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.common.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
 import org.apache.asterix.lang.common.clause.LetClause;
 import org.apache.asterix.lang.common.clause.LimitClause;
@@ -41,92 +41,92 @@ import org.apache.asterix.lang.common.statement.Query;
 public abstract class AbstractAstVisitor<R, T> extends AbstractQueryExpressionVisitor<R, T> {
 
     @Override
-    public R visit(Query q, T arg) throws AsterixException {
+    public R visit(Query q, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(FunctionDecl fd, T arg) throws AsterixException {
+    public R visit(FunctionDecl fd, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(LiteralExpr l, T arg) throws AsterixException {
+    public R visit(LiteralExpr l, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(VariableExpr v, T arg) throws AsterixException {
+    public R visit(VariableExpr v, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(ListConstructor lc, T arg) throws AsterixException {
+    public R visit(ListConstructor lc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(RecordConstructor rc, T arg) throws AsterixException {
+    public R visit(RecordConstructor rc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(OperatorExpr ifbo, T arg) throws AsterixException {
+    public R visit(OperatorExpr ifbo, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(FieldAccessor fa, T arg) throws AsterixException {
+    public R visit(FieldAccessor fa, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(IndexAccessor ia, T arg) throws AsterixException {
+    public R visit(IndexAccessor ia, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(IfExpr ifexpr, T arg) throws AsterixException {
+    public R visit(IfExpr ifexpr, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(QuantifiedExpression qe, T arg) throws AsterixException {
+    public R visit(QuantifiedExpression qe, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(LetClause lc, T arg) throws AsterixException {
+    public R visit(LetClause lc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(WhereClause wc, T arg) throws AsterixException {
+    public R visit(WhereClause wc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(OrderbyClause oc, T arg) throws AsterixException {
+    public R visit(OrderbyClause oc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(GroupbyClause gc, T arg) throws AsterixException {
+    public R visit(GroupbyClause gc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(LimitClause lc, T arg) throws AsterixException {
+    public R visit(LimitClause lc, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(UnaryExpr u, T arg) throws AsterixException {
+    public R visit(UnaryExpr u, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CallExpr pf, T arg) throws AsterixException {
+    public R visit(CallExpr pf, T arg) throws CompilationException {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractQueryExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractQueryExpressionVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractQueryExpressionVisitor.java
index e32615f..a4868d0 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractQueryExpressionVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/AbstractQueryExpressionVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.common.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.clause.UpdateClause;
 import org.apache.asterix.lang.common.expression.OrderedListTypeDefinition;
 import org.apache.asterix.lang.common.expression.RecordTypeDefinition;
@@ -55,162 +55,162 @@ import org.apache.asterix.lang.common.statement.WriteStatement;
 public abstract class AbstractQueryExpressionVisitor<R, T> implements ILangVisitor<R, T> {
 
     @Override
-    public R visit(CreateIndexStatement cis, T arg) throws AsterixException {
+    public R visit(CreateIndexStatement cis, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DataverseDecl dv, T arg) throws AsterixException {
+    public R visit(DataverseDecl dv, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DeleteStatement del, T arg) throws AsterixException {
+    public R visit(DeleteStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DropDatasetStatement del, T arg) throws AsterixException {
+    public R visit(DropDatasetStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DatasetDecl dd, T arg) throws AsterixException {
+    public R visit(DatasetDecl dd, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(InsertStatement insert, T arg) throws AsterixException {
+    public R visit(InsertStatement insert, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(LoadStatement stmtLoad, T arg) throws AsterixException {
+    public R visit(LoadStatement stmtLoad, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(NodegroupDecl ngd, T arg) throws AsterixException {
+    public R visit(NodegroupDecl ngd, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(OrderedListTypeDefinition olte, T arg) throws AsterixException {
+    public R visit(OrderedListTypeDefinition olte, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(RecordTypeDefinition tre, T arg) throws AsterixException {
+    public R visit(RecordTypeDefinition tre, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(SetStatement ss, T arg) throws AsterixException {
+    public R visit(SetStatement ss, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(TypeDecl td, T arg) throws AsterixException {
+    public R visit(TypeDecl td, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(TypeReferenceExpression tre, T arg) throws AsterixException {
+    public R visit(TypeReferenceExpression tre, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(UnorderedListTypeDefinition ulte, T arg) throws AsterixException {
+    public R visit(UnorderedListTypeDefinition ulte, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(UpdateClause del, T arg) throws AsterixException {
+    public R visit(UpdateClause del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(UpdateStatement update, T arg) throws AsterixException {
+    public R visit(UpdateStatement update, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(WriteStatement ws, T arg) throws AsterixException {
+    public R visit(WriteStatement ws, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CreateDataverseStatement del, T arg) throws AsterixException {
+    public R visit(CreateDataverseStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(IndexDropStatement del, T arg) throws AsterixException {
+    public R visit(IndexDropStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(NodeGroupDropStatement del, T arg) throws AsterixException {
+    public R visit(NodeGroupDropStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DataverseDropStatement del, T arg) throws AsterixException {
+    public R visit(DataverseDropStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(TypeDropStatement del, T arg) throws AsterixException {
+    public R visit(TypeDropStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DisconnectFeedStatement del, T arg) throws AsterixException {
+    public R visit(DisconnectFeedStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CreateFunctionStatement cfs, T arg) throws AsterixException {
+    public R visit(CreateFunctionStatement cfs, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(FunctionDropStatement del, T arg) throws AsterixException {
+    public R visit(FunctionDropStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CreatePrimaryFeedStatement del, T arg) throws AsterixException {
+    public R visit(CreatePrimaryFeedStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CreateSecondaryFeedStatement del, T arg) throws AsterixException {
+    public R visit(CreateSecondaryFeedStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(ConnectFeedStatement del, T arg) throws AsterixException {
+    public R visit(ConnectFeedStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(FeedDropStatement del, T arg) throws AsterixException {
+    public R visit(FeedDropStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CompactStatement del, T arg) throws AsterixException {
+    public R visit(CompactStatement del, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(CreateFeedPolicyStatement cfps, T arg) throws AsterixException {
+    public R visit(CreateFeedPolicyStatement cfps, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(FeedPolicyDropStatement dfs, T arg) throws AsterixException {
+    public R visit(FeedPolicyDropStatement dfs, T arg) throws CompilationException {
         return null;
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/ILangVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/ILangVisitor.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/ILangVisitor.java
index 4a16025..4a5c5ed 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/ILangVisitor.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/visitor/base/ILangVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.common.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
 import org.apache.asterix.lang.common.clause.LetClause;
 import org.apache.asterix.lang.common.clause.LimitClause;
@@ -72,104 +72,104 @@ import org.apache.asterix.lang.common.statement.WriteStatement;
 
 public interface ILangVisitor<R, T> {
 
-    R visit(Query q, T arg) throws AsterixException;
+    R visit(Query q, T arg) throws CompilationException;
 
-    R visit(FunctionDecl fd, T arg) throws AsterixException;
+    R visit(FunctionDecl fd, T arg) throws CompilationException;
 
-    R visit(TypeDecl td, T arg) throws AsterixException;
+    R visit(TypeDecl td, T arg) throws CompilationException;
 
-    R visit(NodegroupDecl ngd, T arg) throws AsterixException;
+    R visit(NodegroupDecl ngd, T arg) throws CompilationException;
 
-    R visit(DatasetDecl dd, T arg) throws AsterixException;
+    R visit(DatasetDecl dd, T arg) throws CompilationException;
 
-    R visit(LoadStatement stmtLoad, T arg) throws AsterixException;
+    R visit(LoadStatement stmtLoad, T arg) throws CompilationException;
 
-    R visit(DropDatasetStatement del, T arg) throws AsterixException;
+    R visit(DropDatasetStatement del, T arg) throws CompilationException;
 
-    R visit(InsertStatement insert, T arg) throws AsterixException;
+    R visit(InsertStatement insert, T arg) throws CompilationException;
 
-    R visit(DeleteStatement del, T arg) throws AsterixException;
+    R visit(DeleteStatement del, T arg) throws CompilationException;
 
-    R visit(UpdateStatement update, T arg) throws AsterixException;
+    R visit(UpdateStatement update, T arg) throws CompilationException;
 
-    R visit(UpdateClause del, T arg) throws AsterixException;
+    R visit(UpdateClause del, T arg) throws CompilationException;
 
-    R visit(TypeReferenceExpression tre, T arg) throws AsterixException;
+    R visit(TypeReferenceExpression tre, T arg) throws CompilationException;
 
-    R visit(RecordTypeDefinition tre, T arg) throws AsterixException;
+    R visit(RecordTypeDefinition tre, T arg) throws CompilationException;
 
-    R visit(OrderedListTypeDefinition olte, T arg) throws AsterixException;
+    R visit(OrderedListTypeDefinition olte, T arg) throws CompilationException;
 
-    R visit(UnorderedListTypeDefinition ulte, T arg) throws AsterixException;
+    R visit(UnorderedListTypeDefinition ulte, T arg) throws CompilationException;
 
-    R visit(LiteralExpr l, T arg) throws AsterixException;
+    R visit(LiteralExpr l, T arg) throws CompilationException;
 
-    R visit(VariableExpr v, T arg) throws AsterixException;
+    R visit(VariableExpr v, T arg) throws CompilationException;
 
-    R visit(ListConstructor lc, T arg) throws AsterixException;
+    R visit(ListConstructor lc, T arg) throws CompilationException;
 
-    R visit(RecordConstructor rc, T arg) throws AsterixException;
+    R visit(RecordConstructor rc, T arg) throws CompilationException;
 
-    R visit(OperatorExpr ifbo, T arg) throws AsterixException;
+    R visit(OperatorExpr ifbo, T arg) throws CompilationException;
 
-    R visit(FieldAccessor fa, T arg) throws AsterixException;
+    R visit(FieldAccessor fa, T arg) throws CompilationException;
 
-    R visit(IndexAccessor ia, T arg) throws AsterixException;
+    R visit(IndexAccessor ia, T arg) throws CompilationException;
 
-    R visit(IfExpr ifexpr, T arg) throws AsterixException;
+    R visit(IfExpr ifexpr, T arg) throws CompilationException;
 
-    R visit(QuantifiedExpression qe, T arg) throws AsterixException;
+    R visit(QuantifiedExpression qe, T arg) throws CompilationException;
 
-    R visit(LetClause lc, T arg) throws AsterixException;
+    R visit(LetClause lc, T arg) throws CompilationException;
 
-    R visit(WhereClause wc, T arg) throws AsterixException;
+    R visit(WhereClause wc, T arg) throws CompilationException;
 
-    R visit(OrderbyClause oc, T arg) throws AsterixException;
+    R visit(OrderbyClause oc, T arg) throws CompilationException;
 
-    R visit(GroupbyClause gc, T arg) throws AsterixException;
+    R visit(GroupbyClause gc, T arg) throws CompilationException;
 
-    R visit(LimitClause lc, T arg) throws AsterixException;
+    R visit(LimitClause lc, T arg) throws CompilationException;
 
-    R visit(UnaryExpr u, T arg) throws AsterixException;
+    R visit(UnaryExpr u, T arg) throws CompilationException;
 
-    R visit(CreateIndexStatement cis, T arg) throws AsterixException;
+    R visit(CreateIndexStatement cis, T arg) throws CompilationException;
 
-    R visit(CreateDataverseStatement del, T arg) throws AsterixException;
+    R visit(CreateDataverseStatement del, T arg) throws CompilationException;
 
-    R visit(IndexDropStatement del, T arg) throws AsterixException;
+    R visit(IndexDropStatement del, T arg) throws CompilationException;
 
-    R visit(NodeGroupDropStatement del, T arg) throws AsterixException;
+    R visit(NodeGroupDropStatement del, T arg) throws CompilationException;
 
-    R visit(DataverseDropStatement del, T arg) throws AsterixException;
+    R visit(DataverseDropStatement del, T arg) throws CompilationException;
 
-    R visit(TypeDropStatement del, T arg) throws AsterixException;
+    R visit(TypeDropStatement del, T arg) throws CompilationException;
 
-    R visit(WriteStatement ws, T arg) throws AsterixException;
+    R visit(WriteStatement ws, T arg) throws CompilationException;
 
-    R visit(SetStatement ss, T arg) throws AsterixException;
+    R visit(SetStatement ss, T arg) throws CompilationException;
 
-    R visit(DisconnectFeedStatement del, T arg) throws AsterixException;
+    R visit(DisconnectFeedStatement del, T arg) throws CompilationException;
 
-    R visit(ConnectFeedStatement del, T arg) throws AsterixException;
+    R visit(ConnectFeedStatement del, T arg) throws CompilationException;
 
-    R visit(CreatePrimaryFeedStatement cpfs, T arg) throws AsterixException;
+    R visit(CreatePrimaryFeedStatement cpfs, T arg) throws CompilationException;
 
-    R visit(CreateSecondaryFeedStatement csfs, T arg) throws AsterixException;
+    R visit(CreateSecondaryFeedStatement csfs, T arg) throws CompilationException;
 
-    R visit(FeedDropStatement del, T arg) throws AsterixException;
+    R visit(FeedDropStatement del, T arg) throws CompilationException;
 
-    R visit(FeedPolicyDropStatement dfs, T arg) throws AsterixException;
+    R visit(FeedPolicyDropStatement dfs, T arg) throws CompilationException;
 
-    R visit(CreateFeedPolicyStatement cfps, T arg) throws AsterixException;
+    R visit(CreateFeedPolicyStatement cfps, T arg) throws CompilationException;
 
-    R visit(CallExpr pf, T arg) throws AsterixException;
+    R visit(CallExpr pf, T arg) throws CompilationException;
 
-    R visit(DataverseDecl dv, T arg) throws AsterixException;
+    R visit(DataverseDecl dv, T arg) throws CompilationException;
 
-    R visit(CreateFunctionStatement cfs, T arg) throws AsterixException;
+    R visit(CreateFunctionStatement cfs, T arg) throws CompilationException;
 
-    R visit(FunctionDropStatement del, T arg) throws AsterixException;
+    R visit(FunctionDropStatement del, T arg) throws CompilationException;
 
-    R visit(CompactStatement del, T arg) throws AsterixException;
+    R visit(CompactStatement del, T arg) throws CompilationException;
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/FromClause.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/FromClause.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/FromClause.java
index aff731b..65c2f01 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/FromClause.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/FromClause.java
@@ -23,7 +23,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 import org.apache.asterix.lang.sqlpp.visitor.base.ISqlppVisitor;
@@ -37,7 +37,7 @@ public class FromClause implements Clause {
     }
 
     @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 ((ISqlppVisitor<R, T>) visitor).visit(this, arg);
     }
 


Mime
View raw message