asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjaco...@apache.org
Subject [6/7] asterixdb git commit: Change the compilation related Exception
Date Mon, 16 Jan 2017 18:46:50 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
index 2ee3a2c..ab55c89 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -3438,13 +3438,13 @@
       <test-case FilePath="open-index-enforced/error-checking">
         <compilation-unit name="index-type-collision">
           <output-dir compare="Text">index-type-collision</output-dir>
-          <expected-error>org.apache.asterix.common.exceptions.AsterixException: Cannot create index testIdx2 , enforced index testIdx1 on field "[value]" is already defined with type "[int32]"</expected-error>
+          <expected-error>Cannot create index testIdx2 , enforced index testIdx1 on field "[value]" is already defined with type "[int32]"</expected-error>
         </compilation-unit>
       </test-case>
       <test-case FilePath="open-index-enforced/error-checking">
         <compilation-unit name="index-type-promotion-collision">
           <output-dir compare="Text">index-type-promotion-collision</output-dir>
-          <expected-error>org.apache.asterix.common.exceptions.AsterixException: Cannot create index testIdx2 , enforced index testIdx1 on field "[value]" is already defined with type "[int64]"</expected-error>
+          <expected-error>Cannot create index testIdx2 , enforced index testIdx1 on field "[value]" is already defined with type "[int64]"</expected-error>
         </compilation-unit>
       </test-case>
       <test-case FilePath="open-index-enforced/error-checking">
@@ -6298,7 +6298,7 @@
     <test-case FilePath="cross-dataverse">
       <compilation-unit name="cross-dv13">
         <output-dir compare="Text">cross-dv13</output-dir>
-        <expected-error>Error: Recursive invocation testdv2.fun03@0</expected-error>
+        <expected-error>Recursive invocation testdv2.fun03@0</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="cross-dataverse">
@@ -6314,7 +6314,7 @@
     <test-case FilePath="cross-dataverse">
       <compilation-unit name="cross-dv16">
         <output-dir compare="Text">cross-dv16</output-dir>
-        <expected-error>Error: Recursive invocation testdv1.fun04@0</expected-error>
+        <expected-error>Recursive invocation testdv1.fun04@0</expected-error>
       </compilation-unit>
     </test-case>
     <!--NotImplementedException: No binary comparator factory implemented for type RECORD.
@@ -6353,19 +6353,19 @@
     <test-case FilePath="cross-dataverse">
       <compilation-unit name="drop-type-used-elsewhere">
         <output-dir compare="Text">drop-type-used-elsewhere</output-dir>
-        <expected-error>Error: Cannot drop type a.a being used by dataset b.b1</expected-error>
+        <expected-error>Cannot drop type a.a being used by dataset b.b1</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="cross-dataverse">
       <compilation-unit name="drop-type-used-here-dataset">
         <output-dir compare="Text">drop-type-used-here-dataset</output-dir>
-        <expected-error>Error: Cannot drop type c.a being used by dataset c.a1</expected-error>
+        <expected-error>Cannot drop type c.a being used by dataset c.a1</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="cross-dataverse">
       <compilation-unit name="drop-type-used-here-type">
         <output-dir compare="Text">drop-type-used-here-type</output-dir>
-        <expected-error>Error: Cannot drop type c.a being used by type c.b</expected-error>
+        <expected-error>Cannot drop type c.a being used by type c.b</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="cross-dataverse">
@@ -6403,7 +6403,7 @@
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="query-issue455">
         <output-dir compare="Text">query-issue455</output-dir>
-        <expected-error>Error: function test.printName@0 is not defined</expected-error>
+        <expected-error>function test.printName@0 is not defined</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="user-defined-functions">
@@ -6547,7 +6547,7 @@
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="udf26"><!-- Error not propagated properly -->
         <output-dir compare="Text">udf26</output-dir>
-        <expected-error>Error: function test.needs_f1@1 depends upon function test.f1@0 which is undefined</expected-error>
+        <expected-error>function test.needs_f1@1 depends upon function test.f1@0 which is undefined</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="user-defined-functions"><!-- Exception is never thrown!! -->
@@ -6568,7 +6568,7 @@
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="udf30">
         <output-dir compare="Text">udf30</output-dir>
-        <expected-error>Error: can't find variable $y</expected-error>
+        <expected-error>can't find variable $y</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="user-defined-functions">
@@ -6579,7 +6579,7 @@
     <test-case FilePath="user-defined-functions">
       <compilation-unit name="f01">
         <output-dir compare="Text">f01</output-dir>
-        <expected-error>Error: function test.int8@0 is not defined</expected-error>
+        <expected-error>function test.int8@0 is not defined</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="user-defined-functions">

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/CompilationException.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/CompilationException.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/CompilationException.java
index cb931dc..b53eec4 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/CompilationException.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/CompilationException.java
@@ -24,6 +24,7 @@ import java.io.Serializable;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 
 public class CompilationException extends AlgebricksException {
+    private static final long serialVersionUID = 1L;
 
     public CompilationException(int errorCode, Serializable... params) {
         super(ErrorCode.ASTERIX, errorCode, ErrorCode.getErrorMessage(errorCode), params);
@@ -33,4 +34,35 @@ public class CompilationException extends AlgebricksException {
         super(ErrorCode.ASTERIX, errorCode, ErrorCode.getErrorMessage(errorCode), params);
         addSuppressed(cause);
     }
+
+    /**
+     * @deprecated (Don't use this and provide an error code. This exists for the current exceptions and
+     *             those exceptions need to adopt error code as well.)
+     * @param message
+     */
+    @Deprecated
+    public CompilationException(String message) {
+        super(message);
+    }
+
+    /**
+     * @deprecated (Don't use this and provide an error code. This exists for the current exceptions and
+     *             those exceptions need to adopt error code as well.)
+     * @param message
+     */
+    @Deprecated
+    public CompilationException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * @deprecated (Don't use this and provide an error code. This exists for the current exceptions and
+     *             those exceptions need to adopt error code as well.)
+     * @param message
+     */
+    @Deprecated
+    public CompilationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/DistinctClause.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/DistinctClause.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/DistinctClause.java
index 9ee86e2..bb4d346 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/DistinctClause.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/DistinctClause.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.aql.clause;
 
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.base.IAQLVisitor;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.base.Expression;
@@ -48,7 +48,7 @@ public class DistinctClause 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 ((IAQLVisitor<R, T>) visitor).visit(this, arg);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/ForClause.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/ForClause.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/ForClause.java
index 39e7bbb..6cdc2f3 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/ForClause.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/ForClause.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.aql.clause;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.base.IAQLVisitor;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.base.Expression;
@@ -69,7 +69,7 @@ public class ForClause 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 ((IAQLVisitor<R, T>) visitor).visit(this, arg);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/JoinClause.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/JoinClause.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/JoinClause.java
index 558bd52..4767f4f 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/JoinClause.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/JoinClause.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.aql.clause;
 
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.base.IAQLPlusVisitor;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.base.Expression;
@@ -46,7 +46,7 @@ public class JoinClause 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 ((IAQLPlusVisitor<R, T>) visitor).visitJoinClause(this, arg);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/MetaVariableClause.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/MetaVariableClause.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/MetaVariableClause.java
index a33699e..871c2ce 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/MetaVariableClause.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/clause/MetaVariableClause.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.aql.clause;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.base.IAQLPlusVisitor;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.struct.VarIdentifier;
@@ -28,7 +28,7 @@ public class MetaVariableClause implements Clause {
     private VarIdentifier var;
 
     @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 ((IAQLPlusVisitor<R, T>) visitor).visitMetaVariableClause(this, arg);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/FLWOGRExpression.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/FLWOGRExpression.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/FLWOGRExpression.java
index 0761396..10143f2 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/FLWOGRExpression.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/FLWOGRExpression.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.aql.expression;
 
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.base.IAQLVisitor;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.base.Clause.ClauseType;
@@ -72,7 +72,7 @@ public class FLWOGRExpression implements Expression {
     }
 
     @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 ((IAQLVisitor<R, T>) visitor).visit(this, arg);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/MetaVariableExpr.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/MetaVariableExpr.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/MetaVariableExpr.java
index 99c7902..2964eff 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/MetaVariableExpr.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/MetaVariableExpr.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.aql.expression;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.base.IAQLPlusVisitor;
 import org.apache.asterix.lang.common.expression.VariableExpr;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
@@ -26,7 +26,7 @@ import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 public class MetaVariableExpr extends VariableExpr {
 
     @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 ((IAQLPlusVisitor<R, T>) visitor).visitMetaVariableExpr(this, arg);
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/UnionExpr.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/UnionExpr.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/UnionExpr.java
index 2c8756b..133cb46 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/UnionExpr.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/expression/UnionExpr.java
@@ -21,7 +21,7 @@ package org.apache.asterix.lang.aql.expression;
 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.aql.visitor.base.IAQLVisitor;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
@@ -56,7 +56,7 @@ public class UnionExpr implements Expression {
     }
 
     @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 ((IAQLVisitor<R, T>) visitor).visit(this, arg);
     }
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/parser/FunctionParser.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/parser/FunctionParser.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/parser/FunctionParser.java
index 1f58d08..47a9580 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/parser/FunctionParser.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/parser/FunctionParser.java
@@ -22,7 +22,7 @@ package org.apache.asterix.lang.aql.parser;
 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.IParser;
 import org.apache.asterix.lang.common.base.IParserFactory;
 import org.apache.asterix.lang.common.base.Statement;
@@ -39,7 +39,7 @@ public class FunctionParser {
         this.parserFactory = parserFactory;
     }
 
-    public FunctionDecl getFunctionDecl(Function function) throws AsterixException {
+    public FunctionDecl getFunctionDecl(Function function) throws CompilationException {
         String functionBody = function.getFunctionBody();
         List<String> params = function.getParams();
         List<VarIdentifier> varIdentifiers = new ArrayList<VarIdentifier>();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
index d70f399..977f6bb 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
@@ -22,7 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 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.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
@@ -31,14 +31,13 @@ import org.apache.asterix.lang.aql.expression.UnionExpr;
 import org.apache.asterix.lang.aql.parser.AQLParserFactory;
 import org.apache.asterix.lang.aql.parser.FunctionParser;
 import org.apache.asterix.lang.aql.rewrites.visitor.AqlBuiltinFunctionRewriteVisitor;
-import org.apache.asterix.lang.common.base.IReturningStatement;
-import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
 import org.apache.asterix.lang.aql.visitor.AQLInlineUdfsVisitor;
 import org.apache.asterix.lang.aql.visitor.base.IAQLVisitor;
 import org.apache.asterix.lang.common.base.Clause;
 import org.apache.asterix.lang.common.base.Expression;
-import org.apache.asterix.lang.common.base.IQueryRewriter;
 import org.apache.asterix.lang.common.base.Expression.Kind;
+import org.apache.asterix.lang.common.base.IQueryRewriter;
+import org.apache.asterix.lang.common.base.IReturningStatement;
 import org.apache.asterix.lang.common.clause.GroupbyClause;
 import org.apache.asterix.lang.common.clause.LetClause;
 import org.apache.asterix.lang.common.expression.GbyVariableExpressionPair;
@@ -46,6 +45,7 @@ import org.apache.asterix.lang.common.expression.VariableExpr;
 import org.apache.asterix.lang.common.rewrites.LangRewritingContext;
 import org.apache.asterix.lang.common.statement.FunctionDecl;
 import org.apache.asterix.lang.common.struct.VarIdentifier;
+import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
 import org.apache.asterix.lang.common.util.FunctionUtil;
 import org.apache.asterix.lang.common.visitor.GatherFunctionCallsVisitor;
 import org.apache.asterix.metadata.declared.MetadataProvider;
@@ -68,7 +68,7 @@ class AqlQueryRewriter implements IQueryRewriter {
 
     @Override
     public void rewrite(List<FunctionDecl> declaredFunctions, IReturningStatement topStatement,
-            MetadataProvider metadataProvider, LangRewritingContext context) throws AsterixException {
+            MetadataProvider metadataProvider, LangRewritingContext context) throws CompilationException {
         setup(declaredFunctions, topStatement, metadataProvider, context);
         if (topStatement.isTopLevel()) {
             wrapInLets();
@@ -96,7 +96,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         }
     }
 
-    private void rewriteFunctionName() throws AsterixException {
+    private void rewriteFunctionName() throws CompilationException {
         if (topStatement == null) {
             return;
         }
@@ -104,7 +104,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         topStatement.accept(visitor, null);
     }
 
-    private void inlineDeclaredUdfs() throws AsterixException {
+    private void inlineDeclaredUdfs() throws CompilationException {
         if (topStatement == null) {
             return;
         }
@@ -130,7 +130,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         declaredFunctions.removeAll(storedFunctionDecls);
     }
 
-    private Set<FunctionSignature> getFunctionCalls(Expression expression) throws AsterixException {
+    private Set<FunctionSignature> getFunctionCalls(Expression expression) throws CompilationException {
         GatherFunctionCalls gfc = new GatherFunctionCalls();
         expression.accept(gfc, null);
         return gfc.getCalls();
@@ -142,7 +142,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         }
 
         @Override
-        public Void visit(DistinctClause dc, Void arg) throws AsterixException {
+        public Void visit(DistinctClause dc, Void arg) throws CompilationException {
             for (Expression e : dc.getDistinctByExpr()) {
                 e.accept(this, arg);
             }
@@ -150,7 +150,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         }
 
         @Override
-        public Void visit(FLWOGRExpression flwor, Void arg) throws AsterixException {
+        public Void visit(FLWOGRExpression flwor, Void arg) throws CompilationException {
             for (Clause c : flwor.getClauseList()) {
                 c.accept(this, arg);
             }
@@ -159,7 +159,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         }
 
         @Override
-        public Void visit(ForClause fc, Void arg) throws AsterixException {
+        public Void visit(ForClause fc, Void arg) throws CompilationException {
             fc.getInExpr().accept(this, arg);
             if (fc.getPosVarExpr() != null) {
                 fc.getPosVarExpr().accept(this, arg);
@@ -168,7 +168,7 @@ class AqlQueryRewriter implements IQueryRewriter {
         }
 
         @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);
             }
@@ -179,13 +179,13 @@ class AqlQueryRewriter implements IQueryRewriter {
         }
 
         @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(UnionExpr u, Void arg) throws AsterixException {
+        public Void visit(UnionExpr u, Void arg) throws CompilationException {
             for (Expression e : u.getExprs()) {
                 e.accept(this, arg);
             }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlStatementRewriter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlStatementRewriter.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlStatementRewriter.java
index b9566f4..a89e8bd 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlStatementRewriter.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlStatementRewriter.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.aql.rewrites;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.AqlDeleteRewriteVisitor;
 import org.apache.asterix.lang.common.base.IStatementRewriter;
 import org.apache.asterix.lang.common.base.Statement;
@@ -26,11 +26,11 @@ import org.apache.asterix.lang.common.base.Statement;
 class AqlStatementRewriter implements IStatementRewriter {
 
     @Override
-    public void rewrite(Statement stmt) throws AsterixException {
+    public void rewrite(Statement stmt) throws CompilationException {
         rewriteDeleteStatement(stmt);
     }
 
-    private void rewriteDeleteStatement(Statement stmt) throws AsterixException {
+    private void rewriteDeleteStatement(Statement stmt) throws CompilationException {
         if (stmt != null) {
             AqlDeleteRewriteVisitor visitor = new AqlDeleteRewriteVisitor();
             stmt.accept(visitor, null);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java
index 4c9a615..4f422d4 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java
@@ -22,18 +22,18 @@ package org.apache.asterix.lang.aql.rewrites.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.common.functions.FunctionSignature;
-import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
 import org.apache.asterix.lang.aql.visitor.base.AbstractAqlSimpleExpressionVisitor;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.ILangExpression;
 import org.apache.asterix.lang.common.expression.CallExpr;
+import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
 
 public class AqlBuiltinFunctionRewriteVisitor extends AbstractAqlSimpleExpressionVisitor {
 
     @Override
-    public Expression visit(CallExpr callExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(CallExpr callExpr, ILangExpression arg) throws CompilationException {
         FunctionSignature functionSignature = callExpr.getFunctionSignature();
         callExpr.setFunctionSignature(CommonFunctionMapUtil.normalizeBuiltinFunctionSignature(functionSignature));
         List<Expression> newExprList = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
index f2f04d8..1d0d962 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/statement/SubscribeFeedStatement.java
@@ -26,7 +26,7 @@ import java.util.logging.Logger;
 
 import org.apache.asterix.active.EntityId;
 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.external.feed.management.FeedConnectionRequest;
 import org.apache.asterix.external.feed.policy.FeedPolicyAccessor;
@@ -142,7 +142,7 @@ public class SubscribeFeedStatement implements Statement {
         try {
             statements = parser.parse();
             query = ((InsertStatement) statements.get(3)).getQuery();
-        } catch (AsterixException pe) {
+        } catch (CompilationException pe) {
             throw new MetadataException(pe);
         }
 
@@ -170,7 +170,7 @@ public class SubscribeFeedStatement 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-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLFormatPrintUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLFormatPrintUtil.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLFormatPrintUtil.java
index fe6c5ac..7848bf3 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLFormatPrintUtil.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLFormatPrintUtil.java
@@ -23,7 +23,7 @@ import java.io.PrintWriter;
 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.aql.visitor.AQLFormatPrintVisitor;
 import org.apache.asterix.lang.aql.visitor.AQLToSQLPPPrintVisitor;
 import org.apache.asterix.lang.common.base.ILangExpression;
@@ -31,12 +31,12 @@ import org.apache.asterix.lang.common.base.Statement;
 
 public class AQLFormatPrintUtil {
 
-    public static void print(ILangExpression expr, PrintWriter output) throws AsterixException {
+    public static void print(ILangExpression expr, PrintWriter output) throws CompilationException {
         AQLFormatPrintVisitor visitor = new AQLFormatPrintVisitor(output);
         expr.accept(visitor, 0);
     }
 
-    public static void print(List<Statement> exprs, PrintWriter output) throws AsterixException {
+    public static void print(List<Statement> exprs, PrintWriter output) throws CompilationException {
         AQLFormatPrintVisitor visitor = new AQLFormatPrintVisitor(output);
         for (Statement expr : exprs) {
             expr.accept(visitor, 0);
@@ -47,15 +47,15 @@ public class AQLFormatPrintUtil {
      * @param expr
      *            a language expression.
      * @return a formatted string of a language expression.
-     * @throws AsterixException
+     * @throws CompilationException
      */
-    public static String toString(ILangExpression expr) throws AsterixException {
+    public static String toString(ILangExpression expr) throws CompilationException {
         List<ILangExpression> exprs = new ArrayList<>();
         exprs.add(expr);
         return toString(exprs);
     }
 
-    public static String toString(List<ILangExpression> exprs) throws AsterixException {
+    public static String toString(List<ILangExpression> exprs) throws CompilationException {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         PrintWriter output = new PrintWriter(bos);
         AQLFormatPrintVisitor visitor = new AQLFormatPrintVisitor(output);
@@ -66,7 +66,7 @@ public class AQLFormatPrintUtil {
         return bos.toString();
     }
 
-    public static String toSQLPPString(List<Statement> exprs) throws AsterixException {
+    public static String toSQLPPString(List<Statement> exprs) throws CompilationException {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         PrintWriter output = new PrintWriter(bos);
         AQLToSQLPPPrintVisitor visitor = new AQLToSQLPPPrintVisitor(output);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLVariableSubstitutionUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLVariableSubstitutionUtil.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLVariableSubstitutionUtil.java
index 717eb5c..096b12f 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLVariableSubstitutionUtil.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/AQLVariableSubstitutionUtil.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.aql.util;
 
 import java.util.Map;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.visitor.AQLCloneAndSubstituteVariablesVisitor;
 import org.apache.asterix.lang.common.base.Expression;
 import org.apache.asterix.lang.common.base.ILangExpression;
@@ -31,7 +31,7 @@ import org.apache.asterix.lang.common.rewrites.VariableSubstitutionEnvironment;
 public class AQLVariableSubstitutionUtil {
 
     public static ILangExpression substituteVariable(ILangExpression expression,
-            Map<VariableExpr, Expression> varExprMap) throws AsterixException {
+            Map<VariableExpr, Expression> varExprMap) throws CompilationException {
         AQLCloneAndSubstituteVariablesVisitor visitor = new AQLCloneAndSubstituteVariablesVisitor(
                 new LangRewritingContext(0));
         VariableSubstitutionEnvironment env = new VariableSubstitutionEnvironment(varExprMap);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
index 2e03b8a..9cf8b8d 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/util/RangeMapBuilder.java
@@ -21,7 +21,7 @@ package org.apache.asterix.lang.aql.util;
 import java.io.DataOutput;
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.formats.nontagged.BinaryComparatorFactoryProvider;
 import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
 import org.apache.asterix.lang.aql.parser.AQLParserFactory;
@@ -58,7 +58,7 @@ import org.apache.hyracks.dataflow.common.data.partition.range.RangeMap;
 public abstract class RangeMapBuilder {
     private static final IParserFactory parserFactory = new AQLParserFactory();
 
-    public static IRangeMap parseHint(Object hint) throws AsterixException {
+    public static IRangeMap parseHint(Object hint) throws CompilationException {
         ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
         DataOutput out = abvs.getDataOutput();;
         abvs.reset();
@@ -66,17 +66,17 @@ public abstract class RangeMapBuilder {
         IParser parser = parserFactory.createParser((String) hint);
         List<Statement> hintStatements = parser.parse();
         if (hintStatements.size() != 1) {
-            throw new AsterixException("Only one range statement is allowed for the range hint.");
+            throw new CompilationException("Only one range statement is allowed for the range hint.");
         }
 
         // Translate the query into a Range Map
         if (hintStatements.get(0).getKind() != Statement.Kind.QUERY) {
-            throw new AsterixException("Not a proper query for the range hint.");
+            throw new CompilationException("Not a proper query for the range hint.");
         }
         Query q = (Query) hintStatements.get(0);
 
         if (q.getBody().getKind() != Kind.LIST_CONSTRUCTOR_EXPRESSION) {
-            throw new AsterixException("The range hint must be a list.");
+            throw new CompilationException("The range hint must be a list.");
         }
         List<Expression> el = ((ListConstructor) q.getBody()).getExprList();
         int offsets[] = new int[el.size()];
@@ -95,7 +95,7 @@ public abstract class RangeMapBuilder {
     }
 
     @SuppressWarnings("unchecked")
-    private static void parseLiteralToBytes(Expression item, DataOutput out) throws AsterixException {
+    private static void parseLiteralToBytes(Expression item, DataOutput out) throws CompilationException {
         AMutableDouble aDouble = new AMutableDouble(0);
         AMutableFloat aFloat = new AMutableFloat(0);
         AMutableInt64 aInt64 = new AMutableInt64(0);
@@ -142,11 +142,11 @@ public abstract class RangeMapBuilder {
                             + item.getKind() + " type of expressions.");
             }
         } catch (HyracksDataException e) {
-            throw new AsterixException(e.getMessage());
+            throw new CompilationException(e.getMessage());
         }
     }
 
-    public static void verifyRangeOrder(IRangeMap rangeMap, boolean ascending) throws AsterixException {
+    public static void verifyRangeOrder(IRangeMap rangeMap, boolean ascending) throws CompilationException {
         // TODO Add support for composite fields.
         int fieldIndex = 0;
         int fieldType = rangeMap.getTag(0, 0);
@@ -157,7 +157,7 @@ public abstract class RangeMapBuilder {
         int c = 0;
         for (int split = 1; split < rangeMap.getSplitCount(); ++split) {
             if (fieldType != rangeMap.getTag(fieldIndex, split)) {
-                throw new AsterixException("Range field contains more than a single type of items (" + fieldType
+                throw new CompilationException("Range field contains more than a single type of items (" + fieldType
                         + " and " + rangeMap.getTag(fieldIndex, split) + ").");
             }
             int previousSplit = split - 1;
@@ -167,10 +167,10 @@ public abstract class RangeMapBuilder {
                         rangeMap.getLength(fieldIndex, previousSplit), rangeMap.getByteArray(fieldIndex, split),
                         rangeMap.getStartOffset(fieldIndex, split), rangeMap.getLength(fieldIndex, split));
             } catch (HyracksDataException e) {
-                throw new AsterixException(e);
+                throw new CompilationException(e);
             }
             if (c >= 0) {
-                throw new AsterixException("Range fields are not in sorted order.");
+                throw new CompilationException("Range fields are not in sorted order.");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLAstPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLAstPrintVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLAstPrintVisitor.java
index 0636114..1f76f75 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLAstPrintVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLAstPrintVisitor.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.aql.visitor;
 
 import java.io.PrintWriter;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -45,7 +45,7 @@ class AQLAstPrintVisitor extends QueryPrintVisitor implements IAQLVisitor<Void,
     }
 
     @Override
-    public Void visit(FLWOGRExpression flwor, Integer step) throws AsterixException {
+    public Void visit(FLWOGRExpression flwor, Integer step) throws CompilationException {
         out.println(skip(step) + "FLWOGR [");
         for (Clause cl : flwor.getClauseList()) {
             cl.accept(this, step + 1);
@@ -57,7 +57,7 @@ class AQLAstPrintVisitor extends QueryPrintVisitor implements IAQLVisitor<Void,
     }
 
     @Override
-    public Void visit(ForClause fc, Integer step) throws AsterixException {
+    public Void visit(ForClause fc, Integer step) throws CompilationException {
         out.print(skip(step) + "For ");
         fc.getVarExpr().accept(this, 0);
         out.println(skip(step + 1) + "In ");
@@ -66,7 +66,7 @@ class AQLAstPrintVisitor extends QueryPrintVisitor implements IAQLVisitor<Void,
     }
 
     @Override
-    public Void visit(UnionExpr u, Integer step) throws AsterixException {
+    public Void visit(UnionExpr u, Integer step) throws CompilationException {
         out.println(skip(step) + "Union [");
         for (Expression expr : u.getExprs()) {
             expr.accept(this, step + 1);
@@ -76,7 +76,7 @@ class AQLAstPrintVisitor extends QueryPrintVisitor implements IAQLVisitor<Void,
     }
 
     @Override
-    public Void visit(DistinctClause dc, Integer step) throws AsterixException {
+    public Void visit(DistinctClause dc, Integer step) throws CompilationException {
         out.print(skip(step) + "Distinct ");
         for (Expression expr : dc.getDistinctByExpr()) {
             expr.accept(this, step + 1);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLCloneAndSubstituteVariablesVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLCloneAndSubstituteVariablesVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLCloneAndSubstituteVariablesVisitor.java
index 3352125..0e7b4ad 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLCloneAndSubstituteVariablesVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLCloneAndSubstituteVariablesVisitor.java
@@ -21,7 +21,7 @@ package org.apache.asterix.lang.aql.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.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -49,7 +49,7 @@ public class AQLCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteVar
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(ForClause fc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         Pair<ILangExpression, VariableSubstitutionEnvironment> p1 = fc.getInExpr().accept(this, env);
         VariableExpr varExpr = fc.getVarExpr();
         VariableExpr newVe = generateNewVariable(context, varExpr);
@@ -68,7 +68,7 @@ public class AQLCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteVar
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(FLWOGRExpression flwor,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Clause> newClauses = new ArrayList<Clause>(flwor.getClauseList().size());
         VariableSubstitutionEnvironment currentEnv = env;
         for (Clause c : flwor.getClauseList()) {
@@ -84,7 +84,7 @@ public class AQLCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteVar
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(UnionExpr u,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Expression> exprList = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(u.getExprs(), env, this);
         UnionExpr newU = new UnionExpr(exprList);
         return new Pair<ILangExpression, VariableSubstitutionEnvironment>(newU, env);
@@ -92,7 +92,7 @@ public class AQLCloneAndSubstituteVariablesVisitor extends CloneAndSubstituteVar
 
     @Override
     public Pair<ILangExpression, VariableSubstitutionEnvironment> visit(DistinctClause dc,
-            VariableSubstitutionEnvironment env) throws AsterixException {
+            VariableSubstitutionEnvironment env) throws CompilationException {
         List<Expression> exprList = VariableCloneAndSubstitutionUtil.visitAndCloneExprList(dc.getDistinctByExpr(), env,
                 this);
         DistinctClause dc2 = new DistinctClause(exprList);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLFormatPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLFormatPrintVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLFormatPrintVisitor.java
index ae186ab..a12f089 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLFormatPrintVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLFormatPrintVisitor.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.aql.visitor;
 
 import java.io.PrintWriter;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -44,7 +44,7 @@ public class AQLFormatPrintVisitor extends FormatPrintVisitor implements IAQLVis
     }
 
     @Override
-    public Void visit(FLWOGRExpression flwor, Integer step) throws AsterixException {
+    public Void visit(FLWOGRExpression flwor, Integer step) throws CompilationException {
         for (Clause cl : flwor.getClauseList()) {
             cl.accept(this, step);
         }
@@ -54,7 +54,7 @@ public class AQLFormatPrintVisitor extends FormatPrintVisitor implements IAQLVis
     }
 
     @Override
-    public Void visit(ForClause fc, Integer step) throws AsterixException {
+    public Void visit(ForClause fc, Integer step) throws CompilationException {
         out.print("for ");
         fc.getVarExpr().accept(this, step + 2);
         if (fc.hasPosVar()) {
@@ -68,13 +68,13 @@ public class AQLFormatPrintVisitor extends FormatPrintVisitor implements IAQLVis
     }
 
     @Override
-    public Void visit(UnionExpr u, Integer step) throws AsterixException {
+    public Void visit(UnionExpr u, Integer step) throws CompilationException {
         printDelimitedExpressions(u.getExprs(), "\n" + skip(step) + "union\n", step);
         return null;
     }
 
     @Override
-    public Void visit(DistinctClause dc, Integer step) throws AsterixException {
+    public Void visit(DistinctClause dc, Integer step) throws CompilationException {
         out.print(skip(step) + "distinct by ");
         printDelimitedExpressions(dc.getDistinctByExpr(), COMMA, step + 2);
         out.println();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLInlineUdfsVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLInlineUdfsVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLInlineUdfsVisitor.java
index 71ce034..fb452d2 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLInlineUdfsVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLInlineUdfsVisitor.java
@@ -21,7 +21,7 @@ package org.apache.asterix.lang.aql.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.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -47,7 +47,7 @@ public class AQLInlineUdfsVisitor extends AbstractInlineUdfsVisitor
     }
 
     @Override
-    public Boolean visit(FLWOGRExpression flwor, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(FLWOGRExpression flwor, List<FunctionDecl> arg) throws CompilationException {
         boolean changed = false;
         for (Clause c : flwor.getClauseList()) {
             if (c.accept(this, arg)) {
@@ -60,21 +60,21 @@ public class AQLInlineUdfsVisitor extends AbstractInlineUdfsVisitor
     }
 
     @Override
-    public Boolean visit(ForClause fc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(ForClause fc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, Expression> p = inlineUdfsInExpr(fc.getInExpr(), arg);
         fc.setInExpr(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(UnionExpr u, List<FunctionDecl> fds) throws AsterixException {
+    public Boolean visit(UnionExpr u, List<FunctionDecl> fds) throws CompilationException {
         Pair<Boolean, List<Expression>> p = inlineUdfsInExprList(u.getExprs(), fds);
         u.setExprs(p.second);
         return p.first;
     }
 
     @Override
-    public Boolean visit(DistinctClause dc, List<FunctionDecl> arg) throws AsterixException {
+    public Boolean visit(DistinctClause dc, List<FunctionDecl> arg) throws CompilationException {
         Pair<Boolean, List<Expression>> p = inlineUdfsInExprList(dc.getDistinctByExpr(), arg);
         dc.setDistinctByExpr(p.second);
         return p.first;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
index 0525f80..481dea7 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/AQLToSQLPPPrintVisitor.java
@@ -29,7 +29,7 @@ import java.util.List;
 import java.util.Map;
 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.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
@@ -83,7 +83,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @Override
-    public Void visit(FLWOGRExpression flwor, Integer step) throws AsterixException {
+    public Void visit(FLWOGRExpression flwor, Integer step) throws CompilationException {
         if (step != 0) {
             out.println("(");
         }
@@ -202,14 +202,14 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @Override
-    public Void visit(ForClause fc, Integer step) throws AsterixException {
+    public Void visit(ForClause fc, Integer step) throws CompilationException {
         // The processing of a "for" clause depends on its neighbor clauses,
         // hence the logic goes to visit(FLWOGRExpression).
         return null;
     }
 
     private void visitForClause(ForClause fc, Integer step, boolean startFor, boolean hasConsequentFor)
-            throws AsterixException {
+            throws CompilationException {
         if (startFor) {
             out.print(skip(step) + "from  ");
         } else {
@@ -229,7 +229,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     private void visitLetClause(LetClause lc, Integer step, boolean startLet, boolean hasConsequentLet)
-            throws AsterixException {
+            throws CompilationException {
         if (startLet) {
             out.print(skip(step) + "with  ");
         } else {
@@ -245,7 +245,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @Override
-    public Void visit(Query q, Integer step) throws AsterixException {
+    public Void visit(Query q, Integer step) throws CompilationException {
         Expression expr = q.getBody();
         if (expr != null) {
             if (expr.getKind() != Kind.FLWOGR_EXPRESSION) {
@@ -262,19 +262,19 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @Override
-    public Void visit(DataverseDecl dv, Integer step) throws AsterixException {
+    public Void visit(DataverseDecl dv, Integer step) throws CompilationException {
         out.println(skip(step) + "use " + normalize(dv.getDataverseName().getValue()) + ";\n\n");
         return null;
     }
 
     @Override
-    public Void visit(UnionExpr u, Integer step) throws AsterixException {
+    public Void visit(UnionExpr u, Integer step) throws CompilationException {
         printDelimitedExpressions(u.getExprs(), "\n" + skip(step) + "union\n" + skip(step), step);
         return null;
     }
 
     @Override
-    public Void visit(DistinctClause dc, Integer step) throws AsterixException {
+    public Void visit(DistinctClause dc, Integer step) throws CompilationException {
         return null;
     }
 
@@ -289,7 +289,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @Override
-    public Void visit(LetClause lc, Integer step) throws AsterixException {
+    public Void visit(LetClause lc, Integer step) throws CompilationException {
         out.print(skip(step) + "with ");
         lc.getVarExpr().accept(this, step + 2);
         out.print(" as ");
@@ -300,7 +300,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @Override
-    public Void visit(CallExpr callExpr, Integer step) throws AsterixException {
+    public Void visit(CallExpr callExpr, Integer step) throws CompilationException {
         FunctionSignature signature = callExpr.getFunctionSignature();
         if (signature.getNamespace() != null && signature.getNamespace().equals("Metadata")
                 && signature.getName().equals("dataset") && signature.getArity() == 1) {
@@ -317,7 +317,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @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 */");
         }
@@ -328,7 +328,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @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 " + generateFullName(insert.getDataverseName(), insert.getDatasetName())
                 + "\n");
         insert.getQuery().accept(this, step);
@@ -337,7 +337,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     @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(skip(step) + " from " + generateFullName(del.getDataverseName(), del.getDatasetName()));
@@ -366,7 +366,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
 
     @Override
     protected void printDelimitedGbyExpressions(List<GbyVariableExpressionPair> gbyList, int step)
-            throws AsterixException {
+            throws CompilationException {
         int gbySize = gbyList.size();
         int gbyIndex = 0;
         for (GbyVariableExpressionPair pair : gbyList) {
@@ -445,7 +445,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     // Processes leading "let"s in a FLWOGR.
-    private void processLeadingLetClauses(Integer step, List<Clause> clauseList) throws AsterixException {
+    private void processLeadingLetClauses(Integer step, List<Clause> clauseList) throws CompilationException {
         List<Clause> processedLetList = new ArrayList<Clause>();
         boolean firstLet = true;
         int size = clauseList.size();
@@ -473,10 +473,10 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
      * @param clauseList
      *            , a list of clauses
      * @return the cutting group-by clause and the list of extracted clauses.
-     * @throws AsterixException
+     * @throws CompilationException
      */
     private Pair<GroupbyClause, List<Clause>> extractUnnestAfterGroupby(List<Clause> clauseList)
-            throws AsterixException {
+            throws CompilationException {
         List<Clause> nestedClauses = new ArrayList<Clause>();
         GroupbyClause cuttingGbyClause = null;
         boolean meetGroupBy = false;
@@ -519,7 +519,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
 
     // Extracts the variables to be substituted.
     private Map<VariableExpr, Expression> extractLetBindingVariables(List<Clause> clauses,
-            GroupbyClause cuttingGbyClause) throws AsterixException {
+            GroupbyClause cuttingGbyClause) throws CompilationException {
         Map<VariableExpr, Expression> varExprMap = new HashMap<VariableExpr, Expression>();
         int gbyIndex = clauses.indexOf(cuttingGbyClause);
         for (int i = gbyIndex + 1; i < clauses.size(); i++) {
@@ -560,7 +560,7 @@ public class AQLToSQLPPPrintVisitor extends FormatPrintVisitor implements IAQLVi
     }
 
     // Merge consecutive "where" clauses.
-    private void mergeConsecutiveWhereClauses(List<Clause> clauses) throws AsterixException {
+    private void mergeConsecutiveWhereClauses(List<Clause> clauses) throws CompilationException {
         List<Clause> results = new ArrayList<Clause>();
         int size = clauses.size();
         for (int index = 0; index < size;) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlAstVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlAstVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlAstVisitor.java
index 05c1b81..a2b9ac6 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlAstVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlAstVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.aql.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -28,22 +28,22 @@ import org.apache.asterix.lang.common.visitor.base.AbstractAstVisitor;
 public abstract class AbstractAqlAstVisitor<R, T> extends AbstractAstVisitor<R, T> implements IAQLVisitor<R, T> {
 
     @Override
-    public R visit(FLWOGRExpression flwogreExpr, T arg) throws AsterixException {
+    public R visit(FLWOGRExpression flwogreExpr, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(UnionExpr u, T arg) throws AsterixException {
+    public R visit(UnionExpr u, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(ForClause forClause, T arg) throws AsterixException {
+    public R visit(ForClause forClause, T arg) throws CompilationException {
         return null;
     }
 
     @Override
-    public R visit(DistinctClause distinctClause, T arg) throws AsterixException {
+    public R visit(DistinctClause distinctClause, T arg) throws CompilationException {
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java
index 2b71202..4f52c37 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java
@@ -22,7 +22,7 @@ package org.apache.asterix.lang.aql.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.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -55,7 +55,7 @@ import org.apache.asterix.lang.common.struct.QuantifiedPair;
 public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressionVisitor<Expression, ILangExpression> {
 
     @Override
-    public Expression visit(FLWOGRExpression flwogreExpr, ILangExpression arg) throws AsterixException {
+    public Expression visit(FLWOGRExpression flwogreExpr, ILangExpression arg) throws CompilationException {
         for (Clause clause : flwogreExpr.getClauseList()) {
             clause.accept(this, arg);
         }
@@ -64,49 +64,49 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
     }
 
     @Override
-    public Expression visit(UnionExpr u, ILangExpression arg) throws AsterixException {
+    public Expression visit(UnionExpr u, ILangExpression arg) throws CompilationException {
         u.setExprs(visit(u.getExprs(), arg));
         return u;
     }
 
     @Override
-    public Expression visit(ForClause forClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(ForClause forClause, ILangExpression arg) throws CompilationException {
         forClause.setInExpr(forClause.getInExpr().accept(this, arg));
         return null;
     }
 
     @Override
-    public Expression visit(DistinctClause distinctClause, ILangExpression arg) throws AsterixException {
+    public Expression visit(DistinctClause distinctClause, ILangExpression arg) throws CompilationException {
         distinctClause.setDistinctByExpr(visit(distinctClause.getDistinctByExpr(), arg));
         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));
         }
@@ -114,7 +114,7 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
     }
 
     @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));
@@ -123,24 +123,24 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
     }
 
     @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(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));
@@ -149,13 +149,13 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
     }
 
     @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));
@@ -163,7 +163,7 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
     }
 
     @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));
         }
@@ -172,30 +172,30 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
     }
 
     @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));
@@ -203,19 +203,19 @@ public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressi
         return ia;
     }
 
-    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-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLPlusVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLPlusVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLPlusVisitor.java
index f2037e7..b0c5464 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLPlusVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLPlusVisitor.java
@@ -18,16 +18,16 @@
  */
 package org.apache.asterix.lang.aql.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.clause.JoinClause;
 import org.apache.asterix.lang.aql.clause.MetaVariableClause;
 import org.apache.asterix.lang.aql.expression.MetaVariableExpr;
 
 public interface IAQLPlusVisitor<R, T> extends IAQLVisitor<R, T> {
 
-    R visitJoinClause(JoinClause c, T arg) throws AsterixException;
+    R visitJoinClause(JoinClause c, T arg) throws CompilationException;
 
-    R visitMetaVariableClause(MetaVariableClause c, T arg) throws AsterixException;
+    R visitMetaVariableClause(MetaVariableClause c, T arg) throws CompilationException;
 
-    R visitMetaVariableExpr(MetaVariableExpr v, T arg) throws AsterixException;
+    R visitMetaVariableExpr(MetaVariableExpr v, T arg) throws CompilationException;
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLVisitor.java
index d990005..303f47b 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLVisitor.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/IAQLVisitor.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.aql.visitor.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
 import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
@@ -27,12 +27,12 @@ import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
 public interface IAQLVisitor<R, T> extends ILangVisitor<R, T> {
 
-    R visit(FLWOGRExpression flwogreExpr, T arg) throws AsterixException;
+    R visit(FLWOGRExpression flwogreExpr, T arg) throws CompilationException;
 
-    R visit(UnionExpr u, T arg) throws AsterixException;
+    R visit(UnionExpr u, T arg) throws CompilationException;
 
-    R visit(ForClause forClause, T arg) throws AsterixException;
+    R visit(ForClause forClause, T arg) throws CompilationException;
 
-    R visit(DistinctClause distinctClause, T arg) throws AsterixException;
+    R visit(DistinctClause distinctClause, T arg) throws CompilationException;
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
index 9be5f8a..4b2091c 100644
--- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
+++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
@@ -43,7 +43,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.aql.clause.DistinctClause;
 import org.apache.asterix.lang.aql.clause.ForClause;
@@ -198,7 +198,7 @@ class AQLParser extends ScopeChecker implements IParser {
          try {
            throw new ParseException("Need a binding variable for the enclosed expression: " +
                                        AQLFormatPrintUtil.toString(bodyExpression));
-         } catch (AsterixException e){
+         } catch (CompilationException e){
            throw new ParseException(e.getLocalizedMessage());
          }
        }
@@ -252,7 +252,7 @@ class AQLParser 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"));
         AQLParser parser = new AQLParser(fis);
@@ -260,15 +260,15 @@ class AQLParser extends ScopeChecker implements IParser {
         //st.accept(new AQLPrintVisitor(), 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(e.getMessage());
+            throw new CompilationException(e.getMessage());
         }
     }
 }
@@ -1652,7 +1652,7 @@ Expression OperatorExpr()throws ParseException:
         }
         try{
           op.addOperator(token.image);
-        } catch (AsterixException e){
+        } catch (CompilationException e){
           throw new ParseException(e.getMessage());
         }
     }
@@ -1687,7 +1687,7 @@ Expression AndExpr()throws ParseException:
         }
         try{
           op.addOperator(token.image);
-        } catch (AsterixException e){
+        } catch (CompilationException e){
           throw new ParseException(e.getMessage());
         }
     }
@@ -1743,7 +1743,7 @@ Expression RelExpr()throws ParseException:
           }
          try{
            op.addOperator(token.image);
-         } catch (AsterixException e){
+         } catch (CompilationException e){
            throw new ParseException(e.getMessage());
          }
       }
@@ -1786,7 +1786,7 @@ Expression AddExpr()throws ParseException:
         }
         try{
           ((OperatorExpr)op).addOperator(token.image);
-        } catch (AsterixException e){
+        } catch (CompilationException e){
           throw new ParseException(e.getMessage());
         }
     }
@@ -1819,7 +1819,7 @@ Expression MultExpr()throws ParseException:
         }
         try{
           op.addOperator(token.image);
-        } catch (AsterixException e){
+        } catch (CompilationException e){
           throw new ParseException(e.getMessage());
         }
     }
@@ -1851,7 +1851,7 @@ Expression ExponentExpr()throws ParseException:
         }
         try{
           op.addOperator(token.image);
-        } catch (AsterixException e){
+        } catch (CompilationException e){
           throw new ParseException(e.getMessage());
         }
     }
@@ -1898,7 +1898,7 @@ Expression UnaryExpr() throws ParseException:
           uexpr = new UnaryExpr();
           try{
             uexpr.setExprType(token.image);
-          } catch (AsterixException e){
+          } catch (CompilationException e){
             throw new ParseException(e.getMessage());
           }
     }
@@ -2417,7 +2417,7 @@ Clause OrderbyClause()throws ParseException :
           if (hint.startsWith(RANGE_HINT)) {
             try{
               oc.setRangeMap(RangeMapBuilder.parseHint(hint.substring(RANGE_HINT.length())));
-            } 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-common/src/main/java/org/apache/asterix/lang/common/base/ILangExpression.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/ILangExpression.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/ILangExpression.java
index 5837021..f6b9399 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/ILangExpression.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/ILangExpression.java
@@ -18,9 +18,9 @@
  */
 package org.apache.asterix.lang.common.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.visitor.base.ILangVisitor;
 
 public interface ILangExpression {
-    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;
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IParser.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IParser.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IParser.java
index ad57fa9..b128722 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IParser.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IParser.java
@@ -20,10 +20,10 @@ package org.apache.asterix.lang.common.base;
 
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 
 public interface IParser {
 
-    public List<Statement> parse() throws AsterixException;
+    public List<Statement> parse() throws CompilationException;
 
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IQueryRewriter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IQueryRewriter.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IQueryRewriter.java
index d77592a..0c6c04c 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IQueryRewriter.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IQueryRewriter.java
@@ -20,7 +20,7 @@ package org.apache.asterix.lang.common.base;
 
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 import org.apache.asterix.lang.common.rewrites.LangRewritingContext;
 import org.apache.asterix.lang.common.statement.FunctionDecl;
 import org.apache.asterix.metadata.declared.MetadataProvider;
@@ -40,5 +40,5 @@ public interface IQueryRewriter {
      *            manages ids of variables and guarantees uniqueness of variables.
      */
     public void rewrite(List<FunctionDecl> declaredFunctions, IReturningStatement topExpr,
-            MetadataProvider metadataProvider, LangRewritingContext context) throws AsterixException;
+            MetadataProvider metadataProvider, LangRewritingContext context) throws CompilationException;
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/e65e6ca4/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IStatementRewriter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IStatementRewriter.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IStatementRewriter.java
index ec4f24c..7de67f7 100644
--- a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IStatementRewriter.java
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/IStatementRewriter.java
@@ -18,7 +18,7 @@
  */
 package org.apache.asterix.lang.common.base;
 
-import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.exceptions.CompilationException;
 
 public interface IStatementRewriter {
 
@@ -26,6 +26,6 @@ public interface IStatementRewriter {
      * @param statement,
      *            a non-query statement.
      */
-    public void rewrite(Statement statement) throws AsterixException;
+    public void rewrite(Statement statement) throws CompilationException;
 
 }


Mime
View raw message