tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [36/52] [abbrv] tajo git commit: TAJO-1691: Refactor visitors and planner to throw TajoException.
Date Wed, 22 Jul 2015 13:01:09 GMT
http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
index fb35220..530045c 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
@@ -34,8 +34,8 @@ import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.function.builtin.SumInt;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
 import org.apache.tajo.engine.planner.physical.PhysicalPlanUtil;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.expr.*;
 import org.apache.tajo.plan.logical.*;
 import org.apache.tajo.plan.util.PlannerUtil;
@@ -118,7 +118,7 @@ public class TestPlannerUtil {
   }
 
   @Test
-  public final void testFindTopNode() throws CloneNotSupportedException, PlanningException {
+  public final void testFindTopNode() throws CloneNotSupportedException, TajoException {
     // two relations
     Expr expr = analyzer.parse(TestLogicalPlanner.QUERIES[1]);
     LogicalNode plan = planner.createPlan(LocalTajoTestingUtility.createDummyContext(util.getConfiguration()),

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestQueryValidation.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestQueryValidation.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestQueryValidation.java
index fd60a5e..03316d8 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestQueryValidation.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestQueryValidation.java
@@ -33,7 +33,7 @@ public class TestQueryValidation extends QueryTestCaseBase {
   }
 
   @Test
-  public void testLimitClauses() throws PlanningException, IOException {
+  public void testLimitClauses() throws IOException {
     // select * from lineitem limit 3;
     assertValidSQLFromFile("valid_limit_1.sql");
 
@@ -42,7 +42,7 @@ public class TestQueryValidation extends QueryTestCaseBase {
   }
 
   @Test
-  public void testGroupByClauses() throws PlanningException, IOException {
+  public void testGroupByClauses() throws IOException {
     // select l_orderkey from lineitem group by l_orderkey;
     assertValidSQLFromFile("valid_groupby_1.sql");
 
@@ -53,13 +53,13 @@ public class TestQueryValidation extends QueryTestCaseBase {
   }
 
   @Test
-  public void testCaseWhenExprs() throws PlanningException, IOException {
+  public void testCaseWhenExprs() throws IOException {
     // See TAJO-1098
     assertInvalidSQLFromFile("invalid_casewhen_1.sql");
   }
 
   @Test
-  public void testUnsupportedStoreType() throws PlanningException, IOException {
+  public void testUnsupportedStoreType() throws IOException {
     // See TAJO-1249
     assertInvalidSQLFromFile("invalid_store_format.sql");
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestBNLJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestBNLJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestBNLJoinExec.java
index d198326..dfee911 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestBNLJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestBNLJoinExec.java
@@ -28,15 +28,16 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.util.PlannerUtil;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
-import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.plan.util.PlannerUtil;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
@@ -140,7 +141,7 @@ public class TestBNLJoinExec {
           "inner join people as p on e.empId = p.empId and e.memId = p.fk_memId" };
 
   @Test
-  public final void testBNLCrossJoin() throws IOException, PlanningException {
+  public final void testBNLCrossJoin() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(LocalTajoTestingUtility.createDummyContext(conf),
         expr).getRootBlock().getRoot();
@@ -176,7 +177,7 @@ public class TestBNLJoinExec {
   }
 
   @Test
-  public final void testBNLInnerJoin() throws IOException, PlanningException {
+  public final void testBNLInnerJoin() throws IOException, TajoException {
     Expr context = analyzer.parse(QUERIES[1]);
     LogicalNode plan = planner.createPlan(LocalTajoTestingUtility.createDummyContext(conf),
         context).getRootBlock().getRoot();

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
index 2578de6..9c6e570 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestExternalSortExec.java
@@ -29,13 +29,14 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.LogicalNode;
-import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
@@ -115,7 +116,7 @@ public class TestExternalSortExec {
   };
 
   @Test
-  public final void testNext() throws IOException, PlanningException {
+  public final void testNext() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     Path workDir = new Path(testDir, TestExternalSortExec.class.getName());

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
index 3c9177e..189d68a 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterHashJoinExec.java
@@ -28,16 +28,20 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.util.PlannerUtil;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
-import org.apache.tajo.engine.query.QueryContext;
-import org.apache.tajo.storage.*;
+import org.apache.tajo.plan.util.PlannerUtil;
+import org.apache.tajo.storage.Appender;
+import org.apache.tajo.storage.FileTablespace;
+import org.apache.tajo.storage.TablespaceManager;
+import org.apache.tajo.storage.VTuple;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
 import org.apache.tajo.util.TUtil;
@@ -256,7 +260,7 @@ public class TestFullOuterHashJoinExec {
   };
 
   @Test
-  public final void testFullOuterHashJoinExec0() throws IOException, PlanningException {
+  public final void testFullOuterHashJoinExec0() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -295,7 +299,7 @@ public class TestFullOuterHashJoinExec {
 
 
   @Test
-  public final void testFullOuterHashJoinExec1() throws IOException, PlanningException {
+  public final void testFullOuterHashJoinExec1() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[1]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -333,7 +337,7 @@ public class TestFullOuterHashJoinExec {
   }
 
   @Test
-  public final void testFullOuterHashJoinExec2() throws IOException, PlanningException {
+  public final void testFullOuterHashJoinExec2() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[2]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -372,7 +376,7 @@ public class TestFullOuterHashJoinExec {
 
 
   @Test
-  public final void testFullOuterHashJoinExec3() throws IOException, PlanningException {
+  public final void testFullOuterHashJoinExec3() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[3]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
index 6b32db0..668a7aa 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestFullOuterMergeJoinExec.java
@@ -33,13 +33,16 @@ import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
 import org.apache.tajo.plan.util.PlannerUtil;
-import org.apache.tajo.storage.*;
+import org.apache.tajo.storage.Appender;
+import org.apache.tajo.storage.FileTablespace;
+import org.apache.tajo.storage.TablespaceManager;
+import org.apache.tajo.storage.VTuple;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
 import org.apache.tajo.util.TUtil;
@@ -304,7 +307,7 @@ public class TestFullOuterMergeJoinExec {
   };
 
   @Test
-  public final void testFullOuterMergeJoin0() throws IOException, PlanningException {
+  public final void testFullOuterMergeJoin0() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -341,7 +344,7 @@ public class TestFullOuterMergeJoinExec {
 
 
   @Test
-  public final void testFullOuterMergeJoin1() throws IOException, PlanningException {
+  public final void testFullOuterMergeJoin1() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[1]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -378,7 +381,7 @@ public class TestFullOuterMergeJoinExec {
   }
 
   @Test
-  public final void testFullOuterMergeJoin2() throws IOException, PlanningException {
+  public final void testFullOuterMergeJoin2() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[2]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -416,7 +419,7 @@ public class TestFullOuterMergeJoinExec {
   }
 
   @Test
-  public final void testFullOuterMergeJoin3() throws IOException, PlanningException {
+  public final void testFullOuterMergeJoin3() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[3]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -456,7 +459,7 @@ public class TestFullOuterMergeJoinExec {
 
 
   @Test
-  public final void testFullOuterMergeJoin4() throws IOException, PlanningException {
+  public final void testFullOuterMergeJoin4() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[4]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -495,7 +498,7 @@ public class TestFullOuterMergeJoinExec {
 
 
   @Test
-  public final void testFullOuterMergeJoin5() throws IOException, PlanningException {
+  public final void testFullOuterMergeJoin5() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[5]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
index 1b64a8f..8745024 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
@@ -28,14 +28,15 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.LogicalNode;
-import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
@@ -147,7 +148,7 @@ public class TestHashAntiJoinExec {
   };
 
   @Test
-  public final void testHashAntiJoin() throws IOException, PlanningException {
+  public final void testHashAntiJoin() throws IOException, TajoException {
     FileFragment[] empFrags = FileTablespace.splitNG(conf, "default.e", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     FileFragment[] peopleFrags = FileTablespace.splitNG(conf, "default.p", people.getMeta(),

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
index f7bc1dd..bcee24c 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashJoinExec.java
@@ -30,15 +30,16 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.util.PlannerUtil;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
-import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.plan.util.PlannerUtil;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
@@ -141,7 +142,7 @@ public class TestHashJoinExec {
   };
 
   @Test
-  public final void testHashInnerJoin() throws IOException, PlanningException {
+  public final void testHashInnerJoin() throws IOException, TajoException {
 
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
@@ -185,7 +186,7 @@ public class TestHashJoinExec {
   }
 
   @Test
-  public final void testCheckIfInMemoryInnerJoinIsPossible() throws IOException, PlanningException {
+  public final void testCheckIfInMemoryInnerJoinIsPossible() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
index afa273b..4c10174 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
@@ -32,10 +32,10 @@ import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
@@ -152,7 +152,7 @@ public class TestHashSemiJoinExec {
   };
 
   @Test
-  public final void testHashSemiJoin() throws IOException, PlanningException {
+  public final void testHashSemiJoin() throws IOException, TajoException {
     FileFragment[] empFrags = FileTablespace.splitNG(conf, "default.e", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     FileFragment[] peopleFrags = FileTablespace.splitNG(conf, "default.p", people.getMeta(),

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
index 87bcd20..376ecc5 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestLeftOuterHashJoinExec.java
@@ -28,15 +28,16 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.util.PlannerUtil;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
-import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.plan.util.PlannerUtil;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
@@ -262,7 +263,7 @@ public class TestLeftOuterHashJoinExec {
   };
 
   @Test
-  public final void testLeftOuterHashJoinExec0() throws IOException, PlanningException {
+  public final void testLeftOuterHashJoinExec0() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -298,7 +299,7 @@ public class TestLeftOuterHashJoinExec {
 
 
   @Test
-  public final void testLeftOuter_HashJoinExec1() throws IOException, PlanningException {
+  public final void testLeftOuter_HashJoinExec1() throws IOException, TajoException {
     FileFragment[] job3Frags = FileTablespace.splitNG(conf, JOB3_NAME, job3.getMeta(),
         new Path(job3.getUri()), Integer.MAX_VALUE);
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, EMP3_NAME, emp3.getMeta(),
@@ -331,7 +332,7 @@ public class TestLeftOuterHashJoinExec {
   }
 
     @Test
-  public final void testLeftOuter_HashJoinExec2() throws IOException, PlanningException {
+  public final void testLeftOuter_HashJoinExec2() throws IOException, TajoException {
     
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, EMP3_NAME, emp3.getMeta(),
         new Path(emp3.getUri()), Integer.MAX_VALUE);
@@ -367,7 +368,7 @@ public class TestLeftOuterHashJoinExec {
 
 
    @Test
-  public final void testLeftOuter_HashJoinExec3() throws IOException, PlanningException {
+  public final void testLeftOuter_HashJoinExec3() throws IOException, TajoException {
     
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, EMP3_NAME, emp3.getMeta(),
         new Path(emp3.getUri()), Integer.MAX_VALUE);
@@ -402,7 +403,7 @@ public class TestLeftOuterHashJoinExec {
 
   
    @Test
-  public final void testLeftOuter_HashJoinExec4() throws IOException, PlanningException {
+  public final void testLeftOuter_HashJoinExec4() throws IOException, TajoException {
     
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, "default.emp3", emp3.getMeta(),
         new Path(emp3.getUri()), Integer.MAX_VALUE);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
index d4189bb..40eb463 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestMergeJoinExec.java
@@ -33,9 +33,9 @@ import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
@@ -153,7 +153,7 @@ public class TestMergeJoinExec {
   };
 
   @Test
-  public final void testMergeInnerJoin() throws IOException, PlanningException {
+  public final void testMergeInnerJoin() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalPlan plan = planner.createPlan(LocalTajoTestingUtility.createDummyContext(conf), expr);
     LogicalNode root = plan.getRootBlock().getRoot();

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestNLJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestNLJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestNLJoinExec.java
index 1b30ef8..0fc51e9 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestNLJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestNLJoinExec.java
@@ -28,14 +28,14 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.plan.LogicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.planner.global.MasterPlan;
-import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.plan.LogicalPlanner;
+import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
@@ -142,7 +142,7 @@ public class TestNLJoinExec {
   };
   
   @Test
-  public final void testNLCrossJoin() throws IOException, PlanningException {
+  public final void testNLCrossJoin() throws IOException, TajoException {
     FileFragment[] empFrags = FileTablespace.splitNG(conf, "default.e", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     FileFragment[] peopleFrags = FileTablespace.splitNG(conf, "default.p", people.getMeta(),
@@ -171,7 +171,7 @@ public class TestNLJoinExec {
   }
 
   @Test
-  public final void testNLInnerJoin() throws IOException, PlanningException {
+  public final void testNLInnerJoin() throws IOException, TajoException {
     FileFragment[] empFrags = FileTablespace.splitNG(conf, "default.e", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     FileFragment[] peopleFrags = FileTablespace.splitNG(conf, "default.p", people.getMeta(),

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
index ca4b6b7..6521242 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
@@ -41,10 +41,10 @@ import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.planner.global.DataChannel;
 import org.apache.tajo.engine.planner.global.MasterPlan;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.expr.AggregationFunctionCallEval;
 import org.apache.tajo.plan.logical.*;
 import org.apache.tajo.plan.serder.PlanProto.ShuffleType;
@@ -236,7 +236,7 @@ public class TestPhysicalPlanner {
   };
 
   @Test
-  public final void testCreateScanPlan() throws IOException, PlanningException {
+  public final void testCreateScanPlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testCreateScanPlan");
@@ -267,7 +267,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testCreateScanWithFilterPlan() throws IOException, PlanningException {
+  public final void testCreateScanWithFilterPlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testCreateScanWithFilterPlan");
@@ -296,7 +296,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testGroupByPlan() throws IOException, PlanningException {
+  public final void testGroupByPlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testGroupByPlan");
@@ -326,7 +326,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testHashGroupByPlanWithALLField() throws IOException, PlanningException {
+  public final void testHashGroupByPlanWithALLField() throws IOException, TajoException {
     // TODO - currently, this query does not use hash-based group operator.
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
@@ -357,7 +357,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testSortGroupByPlan() throws IOException, PlanningException {
+  public final void testSortGroupByPlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testSortGroupByPlan");
@@ -420,7 +420,7 @@ public class TestPhysicalPlanner {
   };
 
   @Test
-  public final void testStorePlan() throws IOException, PlanningException {
+  public final void testStorePlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testStorePlan");
@@ -461,7 +461,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testStorePlanWithMaxOutputFileSize() throws IOException, PlanningException,
+  public final void testStorePlanWithMaxOutputFileSize() throws IOException, TajoException,
       CloneNotSupportedException {
 
     TableStats stats = largeScore.getStats();
@@ -517,7 +517,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testStorePlanWithRCFile() throws IOException, PlanningException {
+  public final void testStorePlanWithRCFile() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testStorePlanWithRCFile");
@@ -558,7 +558,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testEnforceForDefaultColumnPartitionStorePlan() throws IOException, PlanningException {
+  public final void testEnforceForDefaultColumnPartitionStorePlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testStorePlan");
@@ -577,7 +577,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testEnforceForHashBasedColumnPartitionStorePlan() throws IOException, PlanningException {
+  public final void testEnforceForHashBasedColumnPartitionStorePlan() throws IOException, TajoException {
 
     Expr context = analyzer.parse(CreateTableAsStmts[2]);
     LogicalPlan plan = planner.createPlan(defaultContext, context);
@@ -601,7 +601,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testEnforceForSortBasedColumnPartitionStorePlan() throws IOException, PlanningException {
+  public final void testEnforceForSortBasedColumnPartitionStorePlan() throws IOException, TajoException {
 
     Expr context = analyzer.parse(CreateTableAsStmts[2]);
     LogicalPlan plan = planner.createPlan(defaultContext, context);
@@ -625,7 +625,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testPartitionedStorePlan() throws IOException, PlanningException {
+  public final void testPartitionedStorePlan() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     TaskAttemptId id = LocalTajoTestingUtility.newTaskAttemptId(masterPlan);
@@ -692,7 +692,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testPartitionedStorePlanWithMaxFileSize() throws IOException, PlanningException {
+  public final void testPartitionedStorePlanWithMaxFileSize() throws IOException, TajoException {
 
     // Preparing working dir and input fragments
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score_large", largeScore.getMeta(),
@@ -758,7 +758,7 @@ public class TestPhysicalPlanner {
 
   @Test
   public final void testPartitionedStorePlanWithEmptyGroupingSet()
-      throws IOException, PlanningException {
+      throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     TaskAttemptId id = LocalTajoTestingUtility.newTaskAttemptId(masterPlan);
@@ -825,7 +825,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testAggregationFunction() throws IOException, PlanningException {
+  public final void testAggregationFunction() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testAggregationFunction");
@@ -856,7 +856,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testCountFunction() throws IOException, PlanningException {
+  public final void testCountFunction() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testCountFunction");
@@ -884,7 +884,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testGroupByWithNullValue() throws IOException, PlanningException {
+  public final void testGroupByWithNullValue() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testGroupByWithNullValue");
@@ -909,7 +909,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testUnionPlan() throws IOException, PlanningException, CloneNotSupportedException {
+  public final void testUnionPlan() throws IOException, TajoException, CloneNotSupportedException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testUnionPlan");
@@ -939,7 +939,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testEvalExpr() throws IOException, PlanningException {
+  public final void testEvalExpr() throws IOException, TajoException {
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testEvalExpr");
     TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf),
         LocalTajoTestingUtility.newTaskAttemptId(masterPlan),
@@ -974,7 +974,7 @@ public class TestPhysicalPlanner {
   };
 
   //@Test
-  public final void testCreateIndex() throws IOException, PlanningException {
+  public final void testCreateIndex() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testCreateIndex");
@@ -1001,7 +1001,7 @@ public class TestPhysicalPlanner {
   };
 
   @Test
-  public final void testDuplicateEliminate() throws IOException, PlanningException {
+  public final void testDuplicateEliminate() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(),
         new Path(score.getUri()), Integer.MAX_VALUE);
 
@@ -1035,7 +1035,7 @@ public class TestPhysicalPlanner {
   };
 
   @Test
-  public final void testSortEnforcer() throws IOException, PlanningException {
+  public final void testSortEnforcer() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
         new Path(employee.getUri()), Integer.MAX_VALUE);
 
@@ -1086,7 +1086,7 @@ public class TestPhysicalPlanner {
   }
 
   @Test
-  public final void testGroupByEnforcer() throws IOException, PlanningException {
+  public final void testGroupByEnforcer() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.score", score.getMeta(), new Path(score.getUri()),
         Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testGroupByEnforcer");

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
index f581db8..eefc02a 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterHashJoinExec.java
@@ -32,8 +32,8 @@ import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
@@ -228,7 +228,7 @@ public class TestRightOuterHashJoinExec {
   };
 
   @Test
-  public final void testRightOuter_HashJoinExec0() throws IOException, PlanningException {
+  public final void testRightOuter_HashJoinExec0() throws IOException, TajoException {
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, EMP3_NAME, emp3.getMeta(), new Path(emp3.getUri()),
         Integer.MAX_VALUE);
     FileFragment[] dep3Frags = FileTablespace.splitNG(conf, DEP3_NAME, dep3.getMeta(), new Path(dep3.getUri()),
@@ -269,7 +269,7 @@ public class TestRightOuterHashJoinExec {
 
 
   @Test
-  public final void testRightOuter_HashJoinExec1() throws IOException, PlanningException {
+  public final void testRightOuter_HashJoinExec1() throws IOException, TajoException {
     FileFragment[] job3Frags = FileTablespace.splitNG(conf, JOB3_NAME, job3.getMeta(), new Path(job3.getUri()),
         Integer.MAX_VALUE);
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, EMP3_NAME, emp3.getMeta(), new Path(emp3.getUri()),
@@ -309,7 +309,7 @@ public class TestRightOuterHashJoinExec {
   }
 
     @Test
-  public final void testRightOuter_HashJoinExec2() throws IOException, PlanningException {
+  public final void testRightOuter_HashJoinExec2() throws IOException, TajoException {
     
     FileFragment[] emp3Frags = FileTablespace.splitNG(conf, EMP3_NAME, emp3.getMeta(), new Path(emp3.getUri()),
         Integer.MAX_VALUE);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
index 51f0e76..9bc6ab3 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestRightOuterMergeJoinExec.java
@@ -28,16 +28,20 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
+import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.util.PlannerUtil;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.JoinNode;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.NodeType;
-import org.apache.tajo.engine.query.QueryContext;
-import org.apache.tajo.storage.*;
+import org.apache.tajo.plan.util.PlannerUtil;
+import org.apache.tajo.storage.Appender;
+import org.apache.tajo.storage.FileTablespace;
+import org.apache.tajo.storage.TablespaceManager;
+import org.apache.tajo.storage.VTuple;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.util.CommonTestingUtil;
 import org.apache.tajo.util.TUtil;
@@ -307,7 +311,7 @@ public class TestRightOuterMergeJoinExec {
   };
 
   @Test
-  public final void testRightOuterMergeJoin0() throws IOException, PlanningException {
+  public final void testRightOuterMergeJoin0() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[0]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -344,7 +348,7 @@ public class TestRightOuterMergeJoinExec {
 
 
   @Test
-  public final void testRightOuter_MergeJoin1() throws IOException, PlanningException {
+  public final void testRightOuter_MergeJoin1() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[1]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -380,7 +384,7 @@ public class TestRightOuterMergeJoinExec {
   }
 
   @Test
-  public final void testRightOuterMergeJoin2() throws IOException, PlanningException {
+  public final void testRightOuterMergeJoin2() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[2]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -416,7 +420,7 @@ public class TestRightOuterMergeJoinExec {
 
 
   @Test
-  public final void testRightOuter_MergeJoin3() throws IOException, PlanningException {
+  public final void testRightOuter_MergeJoin3() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[3]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -453,7 +457,7 @@ public class TestRightOuterMergeJoinExec {
   }
 
   @Test
-  public final void testRightOuter_MergeJoin4() throws IOException, PlanningException {
+  public final void testRightOuter_MergeJoin4() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[4]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);
@@ -490,7 +494,7 @@ public class TestRightOuterMergeJoinExec {
   }
 
   @Test
-  public final void testRightOuterMergeJoin5() throws IOException, PlanningException {
+  public final void testRightOuterMergeJoin5() throws IOException, TajoException {
     Expr expr = analyzer.parse(QUERIES[5]);
     LogicalNode plan = planner.createPlan(defaultContext, expr).getRootBlock().getRoot();
     JoinNode joinNode = PlannerUtil.findTopNode(plan, NodeType.JOIN);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
index 4690e71..625fbec 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
@@ -30,11 +30,17 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
 import org.apache.tajo.engine.parser.SQLAnalyzer;
-import org.apache.tajo.engine.planner.*;
+import org.apache.tajo.engine.planner.PhysicalPlanner;
+import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
+import org.apache.tajo.engine.planner.RangePartitionAlgorithm;
+import org.apache.tajo.engine.planner.UniformRangePartition;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
-import org.apache.tajo.plan.*;
-import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.plan.LogicalOptimizer;
+import org.apache.tajo.plan.LogicalPlan;
+import org.apache.tajo.plan.LogicalPlanner;
+import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.util.PlannerUtil;
 import org.apache.tajo.storage.*;
 import org.apache.tajo.storage.fragment.FileFragment;
@@ -109,7 +115,7 @@ public class TestSortExec {
       "select managerId, empId, deptName from employee order by managerId, empId desc" };
 
   @Test
-  public final void testNext() throws IOException, PlanningException {
+  public final void testNext() throws IOException, TajoException {
     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employeeMeta, tablePath, Integer.MAX_VALUE);
     Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/TestSortExec");
     TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf),

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
index 3372651..440eb31 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
@@ -23,7 +23,6 @@ import org.apache.tajo.LocalTajoTestingUtility;
 import org.apache.tajo.TajoTestingCluster;
 import org.apache.tajo.algebra.Expr;
 import org.apache.tajo.catalog.*;
-import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
@@ -33,10 +32,10 @@ import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.enforce.Enforcer;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.PlanningException;
 import org.apache.tajo.plan.logical.LogicalNode;
 import org.apache.tajo.plan.logical.SortNode;
 import org.apache.tajo.plan.util.PlannerUtil;
@@ -159,7 +158,7 @@ public class TestSortIntersectExec {
   };
 
   @Test
-  public final void testSortIntersectAll() throws IOException, PlanningException {
+  public final void testSortIntersectAll() throws IOException, TajoException {
     FileFragment[] empFrags1 = ((FileTablespace) TablespaceManager.getLocalFs()).
         splitNG(conf, "default.e1", employee1.getMeta(),
             new Path(employee1.getUri()), Integer.MAX_VALUE);
@@ -226,7 +225,7 @@ public class TestSortIntersectExec {
   }
 
   @Test
-  public final void testSortIntersect() throws IOException, PlanningException {
+  public final void testSortIntersect() throws IOException, TajoException {
     FileFragment[] empFrags1 = ((FileTablespace) TablespaceManager.getLocalFs())
         .splitNG(conf, "default.e1", employee1.getMeta(),
             new Path(employee1.getUri()), Integer.MAX_VALUE);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-plan/src/main/java/org/apache/tajo/plan/ExprAnnotator.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/ExprAnnotator.java b/tajo-plan/src/main/java/org/apache/tajo/plan/ExprAnnotator.java
index 453edd5..bc6acbe 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/ExprAnnotator.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/ExprAnnotator.java
@@ -30,11 +30,10 @@ import org.apache.tajo.catalog.FunctionDesc;
 import org.apache.tajo.catalog.exception.UndefinedFunctionException;
 import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.datum.*;
-import org.apache.tajo.error.Errors;
-import org.apache.tajo.error.Errors.ResultCode;
-import org.apache.tajo.exception.InvalidOperationException;
-import org.apache.tajo.exception.SQLExceptionUtil;
-import org.apache.tajo.function.FunctionUtil;
+import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.exception.TajoInternalError;
+import org.apache.tajo.exception.UnimplementedException;
+import org.apache.tajo.exception.UnsupportedException;
 import org.apache.tajo.plan.algebra.BaseAlgebraVisitor;
 import org.apache.tajo.plan.expr.*;
 import org.apache.tajo.plan.logical.NodeType;
@@ -45,7 +44,6 @@ import org.apache.tajo.util.TUtil;
 import org.apache.tajo.util.datetime.DateTimeUtil;
 import org.apache.tajo.util.datetime.TimeMeta;
 
-import java.sql.SQLException;
 import java.util.Set;
 import java.util.Stack;
 import java.util.TimeZone;
@@ -56,6 +54,7 @@ import static org.apache.tajo.catalog.proto.CatalogProtos.FunctionType;
 import static org.apache.tajo.common.TajoDataTypes.DataType;
 import static org.apache.tajo.common.TajoDataTypes.Type;
 import static org.apache.tajo.plan.logical.WindowSpec.*;
+import static org.apache.tajo.plan.verifier.SyntaxErrorUtil.makeSyntaxError;
 
 /**
  * <code>ExprAnnotator</code> makes an annotated expression called <code>EvalNode</code> from an
@@ -87,15 +86,14 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   public EvalNode createEvalNode(LogicalPlanner.PlanContext planContext, Expr expr,
-                                 NameResolvingMode colRsvLevel)
-      throws PlanningException {
+                                 NameResolvingMode colRsvLevel) throws TajoException {
     Context context = new Context(planContext, colRsvLevel);
     return planContext.evalOptimizer.optimize(planContext, visit(context, new Stack<Expr>(), expr));
   }
 
-  public static void assertEval(boolean condition, String message) throws PlanningException {
+  public static void assertEval(boolean condition, String message) throws TajoException {
     if (!condition) {
-      throw new PlanningException(message);
+      throw makeSyntaxError(message);
     }
   }
 
@@ -199,7 +197,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public EvalNode visitAnd(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitAnd(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -209,7 +207,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitOr(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitOr(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -219,7 +217,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitNot(Context ctx, Stack<Expr> stack, NotExpr expr) throws PlanningException {
+  public EvalNode visitNot(Context ctx, Stack<Expr> stack, NotExpr expr) throws TajoException {
     stack.push(expr);
     EvalNode child = visit(ctx, stack, expr.getChild());
     stack.pop();
@@ -230,37 +228,37 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   // Comparison Predicates Section
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
   @Override
-  public EvalNode visitEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     return visitCommonComparison(ctx, stack, expr);
   }
 
   @Override
-  public EvalNode visitNotEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitNotEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     return visitCommonComparison(ctx, stack, expr);
   }
 
   @Override
-  public EvalNode visitLessThan(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitLessThan(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     return visitCommonComparison(ctx, stack, expr);
   }
 
   @Override
-  public EvalNode visitLessThanOrEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitLessThanOrEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     return visitCommonComparison(ctx, stack, expr);
   }
 
   @Override
-  public EvalNode visitGreaterThan(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitGreaterThan(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     return visitCommonComparison(ctx, stack, expr);
   }
 
   @Override
   public EvalNode visitGreaterThanOrEquals(Context ctx, Stack<Expr> stack, BinaryOperator expr)
-      throws PlanningException {
+      throws TajoException {
     return visitCommonComparison(ctx, stack, expr);
   }
 
-  public EvalNode visitCommonComparison(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitCommonComparison(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -298,7 +296,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public EvalNode visitBetween(Context ctx, Stack<Expr> stack, BetweenPredicate between) throws PlanningException {
+  public EvalNode visitBetween(Context ctx, Stack<Expr> stack, BetweenPredicate between) throws TajoException {
     stack.push(between);
     EvalNode predicand = visit(ctx, stack, between.predicand());
     EvalNode begin = visit(ctx, stack, between.begin());
@@ -306,13 +304,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
     stack.pop();
 
     // implicit type conversion
-    DataType widestType = null;
-
-    try {
-      widestType = CatalogUtil.getWidestType(predicand.getValueType(), begin.getValueType(), end.getValueType());
-    } catch (InvalidOperationException ioe) {
-      throw new PlanningException(ioe);
-    }
+    DataType widestType = CatalogUtil.getWidestType(predicand.getValueType(), begin.getValueType(), end.getValueType());
 
     BetweenPredicateEval betweenEval = new BetweenPredicateEval(
         between.isNot(),
@@ -324,7 +316,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitCaseWhen(Context ctx, Stack<Expr> stack, CaseWhenPredicate caseWhen) throws PlanningException {
+  public EvalNode visitCaseWhen(Context ctx, Stack<Expr> stack, CaseWhenPredicate caseWhen) throws TajoException {
     CaseWhenEval caseWhenEval = new CaseWhenEval();
 
     EvalNode condition;
@@ -359,7 +351,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitIsNullPredicate(Context ctx, Stack<Expr> stack, IsNullPredicate expr) throws PlanningException {
+  public EvalNode visitIsNullPredicate(Context ctx, Stack<Expr> stack, IsNullPredicate expr) throws TajoException {
     stack.push(expr);
     EvalNode child = visit(ctx, stack, expr.getPredicand());
     stack.pop();
@@ -367,7 +359,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitInPredicate(Context ctx, Stack<Expr> stack, InPredicate expr) throws PlanningException {
+  public EvalNode visitInPredicate(Context ctx, Stack<Expr> stack, InPredicate expr) throws TajoException {
     stack.push(expr);
     EvalNode lhs = visit(ctx, stack, expr.getLeft());
     RowConstantEval rowConstantEval = (RowConstantEval) visit(ctx, stack, expr.getInValue());
@@ -379,13 +371,13 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitValueListExpr(Context ctx, Stack<Expr> stack, ValueListExpr expr) throws PlanningException {
+  public EvalNode visitValueListExpr(Context ctx, Stack<Expr> stack, ValueListExpr expr) throws TajoException {
     Datum[] values = new Datum[expr.getValues().length];
     EvalNode [] evalNodes = new EvalNode[expr.getValues().length];
     for (int i = 0; i < expr.getValues().length; i++) {
       evalNodes[i] = visit(ctx, stack, expr.getValues()[i]);
       if (!EvalTreeUtil.checkIfCanBeConstant(evalNodes[i])) {
-        throw new PlanningException("Non constant values cannot be included in IN PREDICATE.");
+        throw makeSyntaxError("Non constant values cannot be included in IN PREDICATE.");
       }
       values[i] = EvalTreeUtil.evaluateImmediately(null, evalNodes[i]);
     }
@@ -393,8 +385,8 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitExistsPredicate(Context ctx, Stack<Expr> stack, ExistsPredicate expr) throws PlanningException {
-    throw new PlanningException("Cannot support EXISTS clause yet");
+  public EvalNode visitExistsPredicate(Context ctx, Stack<Expr> stack, ExistsPredicate expr) throws TajoException {
+    throw new UnimplementedException("EXISTS clause");
   }
 
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -402,24 +394,24 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
   @Override
   public EvalNode visitLikePredicate(Context ctx, Stack<Expr> stack, PatternMatchPredicate expr)
-      throws PlanningException {
+      throws TajoException {
     return visitPatternMatchPredicate(ctx, stack, expr);
   }
 
   @Override
   public EvalNode visitSimilarToPredicate(Context ctx, Stack<Expr> stack, PatternMatchPredicate expr)
-      throws PlanningException {
+      throws TajoException {
     return visitPatternMatchPredicate(ctx, stack, expr);
   }
 
   @Override
   public EvalNode visitRegexpPredicate(Context ctx, Stack<Expr> stack, PatternMatchPredicate expr)
-      throws PlanningException {
+      throws TajoException {
     return visitPatternMatchPredicate(ctx, stack, expr);
   }
 
   @Override
-  public EvalNode visitConcatenate(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitConcatenate(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode lhs = visit(ctx, stack, expr.getLeft());
     EvalNode rhs = visit(ctx, stack, expr.getRight());
@@ -436,7 +428,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   private EvalNode visitPatternMatchPredicate(Context ctx, Stack<Expr> stack, PatternMatchPredicate expr)
-      throws PlanningException {
+      throws TajoException {
     EvalNode field = visit(ctx, stack, expr.getPredicand());
     ConstEval pattern = (ConstEval) visit(ctx, stack, expr.getPattern());
 
@@ -465,7 +457,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitPlus(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitPlus(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -475,7 +467,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitMinus(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitMinus(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -485,7 +477,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitMultiply(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitMultiply(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -495,7 +487,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitDivide(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitDivide(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -505,7 +497,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitModular(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public EvalNode visitModular(Context ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
     EvalNode left = visit(ctx, stack, expr.getLeft());
     EvalNode right = visit(ctx, stack, expr.getRight());
@@ -519,7 +511,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public EvalNode visitSign(Context ctx, Stack<Expr> stack, SignedExpr expr) throws PlanningException {
+  public EvalNode visitSign(Context ctx, Stack<Expr> stack, SignedExpr expr) throws TajoException {
     stack.push(expr);
     EvalNode numericExpr = visit(ctx, stack, expr.getChild());
     stack.pop();
@@ -533,7 +525,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
 
   @Override
   public EvalNode visitColumnReference(Context ctx, Stack<Expr> stack, ColumnReferenceExpr expr)
-      throws PlanningException {
+      throws TajoException {
     Column column;
 
     switch (ctx.columnRsvLevel) {
@@ -546,14 +538,14 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
       column = NameResolver.resolve(ctx.plan, ctx.currentBlock, expr, ctx.columnRsvLevel);
       break;
     default:
-      throw new PlanningException("Unsupported column resolving level: " + ctx.columnRsvLevel.name());
+      throw new TajoInternalError("Unsupported column resolving level: " + ctx.columnRsvLevel.name());
     }
     return new FieldEval(column);
   }
 
   @Override
-  public EvalNode visitTargetExpr(Context ctx, Stack<Expr> stack, NamedExpr expr) throws PlanningException {
-    throw new PlanningException("ExprAnnotator cannot take NamedExpr");
+  public EvalNode visitTargetExpr(Context ctx, Stack<Expr> stack, NamedExpr expr) throws TajoException {
+    throw new TajoInternalError("ExprAnnotator cannot take NamedExpr");
   }
 
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -561,7 +553,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public EvalNode visitFunction(Context ctx, Stack<Expr> stack, FunctionExpr expr) throws PlanningException {
+  public EvalNode visitFunction(Context ctx, Stack<Expr> stack, FunctionExpr expr) throws TajoException {
     stack.push(expr); // <--- Push
 
     // Given parameters
@@ -619,15 +611,15 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
       return new AggregationFunctionCallEval(funcDesc, givenArgs);
     } else if (functionType == FunctionType.DISTINCT_AGGREGATION
         || functionType == FunctionType.DISTINCT_UDA) {
-      throw new PlanningException("Unsupported function: " + funcDesc.toString());
+      throw new UnsupportedException(funcDesc.toString());
     } else {
-      throw new PlanningException("Unsupported Function Type: " + functionType.name());
+      throw new UnsupportedException("function type '" + functionType.name() + "'");
     }
   }
 
   @Override
   public EvalNode visitCountRowsFunction(Context ctx, Stack<Expr> stack, CountRowsFunctionExpr expr)
-      throws PlanningException {
+      throws TajoException {
     FunctionDesc countRows = catalog.getFunction("count", FunctionType.AGGREGATION,
         new DataType[] {});
     if (countRows == null) {
@@ -640,7 +632,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
 
   @Override
   public EvalNode visitGeneralSetFunction(Context ctx, Stack<Expr> stack, GeneralSetFunctionExpr setFunction)
-      throws PlanningException {
+      throws TajoException {
 
     Expr[] params = setFunction.getParams();
     EvalNode[] givenArgs = new EvalNode[params.length];
@@ -672,7 +664,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
           Sets.newHashSet("row_number", "rank", "dense_rank", "percent_rank", "cume_dist", "first_value", "lag"));
 
   public EvalNode visitWindowFunction(Context ctx, Stack<Expr> stack, WindowFunctionExpr windowFunc)
-      throws PlanningException {
+      throws TajoException {
 
     WindowSpec windowSpec = windowFunc.getWindowSpec();
 
@@ -758,12 +750,12 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public EvalNode visitDataType(Context ctx, Stack<Expr> stack, DataTypeExpr expr) throws PlanningException {
+  public EvalNode visitDataType(Context ctx, Stack<Expr> stack, DataTypeExpr expr) throws TajoException {
     return super.visitDataType(ctx, stack, expr);
   }
 
   @Override
-  public EvalNode visitCastExpr(Context ctx, Stack<Expr> stack, CastExpr expr) throws PlanningException {
+  public EvalNode visitCastExpr(Context ctx, Stack<Expr> stack, CastExpr expr) throws TajoException {
     EvalNode child = super.visitCastExpr(ctx, stack, expr);
 
     // if it is a casting operation for a constant value, it will be pre-computed and casted to a constant value.
@@ -788,7 +780,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitLiteral(Context ctx, Stack<Expr> stack, LiteralValue expr) throws PlanningException {
+  public EvalNode visitLiteral(Context ctx, Stack<Expr> stack, LiteralValue expr) throws TajoException {
     switch (expr.getValueType()) {
     case Boolean:
       return new ConstEval(DatumFactory.createBool(Boolean.parseBoolean(expr.getValue())));
@@ -806,12 +798,12 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitNullLiteral(Context ctx, Stack<Expr> stack, NullLiteral expr) throws PlanningException {
+  public EvalNode visitNullLiteral(Context ctx, Stack<Expr> stack, NullLiteral expr) throws TajoException {
     return new ConstEval(NullDatum.get());
   }
 
   @Override
-  public EvalNode visitDateLiteral(Context context, Stack<Expr> stack, DateLiteral expr) throws PlanningException {
+  public EvalNode visitDateLiteral(Context context, Stack<Expr> stack, DateLiteral expr) throws TajoException {
     DateValue dateValue = expr.getDate();
     int[] dates = dateToIntArray(dateValue.getYears(), dateValue.getMonths(), dateValue.getDays());
 
@@ -827,7 +819,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
 
   @Override
   public EvalNode visitTimestampLiteral(Context ctx, Stack<Expr> stack, TimestampLiteral expr)
-      throws PlanningException {
+      throws TajoException {
     DateValue dateValue = expr.getDate();
     TimeValue timeValue = expr.getTime();
 
@@ -859,12 +851,12 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   @Override
-  public EvalNode visitIntervalLiteral(Context ctx, Stack<Expr> stack, IntervalLiteral expr) throws PlanningException {
+  public EvalNode visitIntervalLiteral(Context ctx, Stack<Expr> stack, IntervalLiteral expr) throws TajoException {
     return new ConstEval(new IntervalDatum(expr.getExprStr()));
   }
 
   @Override
-  public EvalNode visitTimeLiteral(Context ctx, Stack<Expr> stack, TimeLiteral expr) throws PlanningException {
+  public EvalNode visitTimeLiteral(Context ctx, Stack<Expr> stack, TimeLiteral expr) throws TajoException {
     TimeValue timeValue = expr.getTime();
     int [] times = timeToIntArray(timeValue.getHours(),
         timeValue.getMinutes(),
@@ -889,21 +881,21 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   public static int [] dateToIntArray(String years, String months, String days)
-      throws PlanningException {
+      throws TajoException {
     int year = Integer.parseInt(years);
     int month = Integer.parseInt(months);
     int day = Integer.parseInt(days);
 
     if (!(1 <= year && year <= 9999)) {
-      throw new PlanningException(String.format("Years (%d) must be between 1 and 9999 integer value", year));
+      throw makeSyntaxError(String.format("Years (%d) must be between 1 and 9999 integer value", year));
     }
 
     if (!(1 <= month && month <= 12)) {
-      throw new PlanningException(String.format("Months (%d) must be between 1 and 12 integer value", month));
+      throw makeSyntaxError(String.format("Months (%d) must be between 1 and 12 integer value", month));
     }
 
     if (!(1<= day && day <= 31)) {
-      throw new PlanningException(String.format("Days (%d) must be between 1 and 31 integer value", day));
+      throw makeSyntaxError(String.format("Days (%d) must be between 1 and 31 integer value", day));
     }
 
     int [] results = new int[3];
@@ -915,7 +907,7 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
   }
 
   public static int [] timeToIntArray(String hours, String minutes, String seconds, String fractionOfSecond)
-      throws PlanningException {
+      throws TajoException {
     int hour = Integer.parseInt(hours);
     int minute = Integer.parseInt(minutes);
     int second = Integer.parseInt(seconds);
@@ -925,20 +917,20 @@ public class ExprAnnotator extends BaseAlgebraVisitor<ExprAnnotator.Context, Eva
     }
 
     if (!(0 <= hour && hour <= 23)) {
-      throw new PlanningException(String.format("Hours (%d) must be between 0 and 24 integer value", hour));
+      throw makeSyntaxError(String.format("Hours (%d) must be between 0 and 24 integer value", hour));
     }
 
     if (!(0 <= minute && minute <= 59)) {
-      throw new PlanningException(String.format("Minutes (%d) must be between 0 and 59 integer value", minute));
+      throw makeSyntaxError(String.format("Minutes (%d) must be between 0 and 59 integer value", minute));
     }
 
     if (!(0 <= second && second <= 59)) {
-      throw new PlanningException(String.format("Seconds (%d) must be between 0 and 59 integer value", second));
+      throw makeSyntaxError(String.format("Seconds (%d) must be between 0 and 59 integer value", second));
     }
 
     if (fraction != 0) {
       if (!(0 <= fraction && fraction <= 999)) {
-        throw new PlanningException(String.format("Seconds (%d) must be between 0 and 999 integer value", fraction));
+        throw makeSyntaxError(String.format("Seconds (%d) must be between 0 and 999 integer value", fraction));
       }
     }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/4841c656/tajo-plan/src/main/java/org/apache/tajo/plan/ExprNormalizer.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/ExprNormalizer.java b/tajo-plan/src/main/java/org/apache/tajo/plan/ExprNormalizer.java
index d61049e..c89f10a 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/ExprNormalizer.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/ExprNormalizer.java
@@ -22,6 +22,7 @@ import com.google.common.collect.Sets;
 import org.apache.tajo.algebra.*;
 import org.apache.tajo.catalog.CatalogUtil;
 import org.apache.tajo.catalog.exception.UndefinedColumnException;
+import org.apache.tajo.exception.TajoException;
 import org.apache.tajo.plan.nameresolver.NameResolver;
 import org.apache.tajo.plan.nameresolver.NameResolvingMode;
 import org.apache.tajo.plan.visitor.SimpleAlgebraVisitor;
@@ -111,11 +112,11 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
     }
   }
 
-  public ExprNormalizedResult normalize(LogicalPlanner.PlanContext context, Expr expr) throws PlanningException {
+  public ExprNormalizedResult normalize(LogicalPlanner.PlanContext context, Expr expr) throws TajoException {
     return normalize(context, expr, false);
   }
   public ExprNormalizedResult normalize(LogicalPlanner.PlanContext context, Expr expr, boolean subexprElimination)
-      throws PlanningException {
+      throws TajoException {
     ExprNormalizedResult exprNormalizedResult = new ExprNormalizedResult(context, subexprElimination);
     Stack<Expr> stack = new Stack<Expr>();
     stack.push(expr);
@@ -126,7 +127,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
 
   @Override
   public Object visitCaseWhen(ExprNormalizedResult ctx, Stack<Expr> stack, CaseWhenPredicate expr)
-      throws PlanningException {
+      throws TajoException {
     stack.push(expr);
     for (CaseWhenPredicate.WhenExpr when : expr.getWhens()) {
       visit(ctx, stack, when.getCondition());
@@ -158,7 +159,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
   }
 
   @Override
-  public Expr visitUnaryOperator(ExprNormalizedResult ctx, Stack<Expr> stack, UnaryOperator expr) throws PlanningException {
+  public Expr visitUnaryOperator(ExprNormalizedResult ctx, Stack<Expr> stack, UnaryOperator expr) throws TajoException {
     super.visitUnaryOperator(ctx, stack, expr);
     if (OpType.isAggregationFunction(expr.getChild().getType())) {
       // Get an anonymous column name and replace the aggregation function by the column name
@@ -176,7 +177,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
   }
 
   @Override
-  public Expr visitBinaryOperator(ExprNormalizedResult ctx, Stack<Expr> stack, BinaryOperator expr) throws PlanningException {
+  public Expr visitBinaryOperator(ExprNormalizedResult ctx, Stack<Expr> stack, BinaryOperator expr) throws TajoException {
     stack.push(expr);
 
     visit(ctx, new Stack<Expr>(), expr.getLeft());
@@ -220,7 +221,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public Expr visitFunction(ExprNormalizedResult ctx, Stack<Expr> stack, FunctionExpr expr) throws PlanningException {
+  public Expr visitFunction(ExprNormalizedResult ctx, Stack<Expr> stack, FunctionExpr expr) throws TajoException {
     stack.push(expr);
 
     Expr param;
@@ -244,7 +245,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
 
   @Override
   public Expr visitGeneralSetFunction(ExprNormalizedResult ctx, Stack<Expr> stack, GeneralSetFunctionExpr expr)
-      throws PlanningException {
+      throws TajoException {
     stack.push(expr);
 
     Expr param;
@@ -266,7 +267,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
   }
 
   public Expr visitWindowFunction(ExprNormalizedResult ctx, Stack<Expr> stack, WindowFunctionExpr expr)
-      throws PlanningException {
+      throws TajoException {
     stack.push(expr);
 
     WindowSpec windowSpec = expr.getWindowSpec();
@@ -318,7 +319,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
   @Override
-  public Expr visitCastExpr(ExprNormalizedResult ctx, Stack<Expr> stack, CastExpr expr) throws PlanningException {
+  public Expr visitCastExpr(ExprNormalizedResult ctx, Stack<Expr> stack, CastExpr expr) throws TajoException {
     super.visitCastExpr(ctx, stack, expr);
     if (OpType.isAggregationFunction(expr.getType())) {
       String referenceName = ctx.block.namedExprsMgr.addExpr(expr.getChild());
@@ -330,7 +331,7 @@ class ExprNormalizer extends SimpleAlgebraVisitor<ExprNormalizer.ExprNormalizedR
 
   @Override
   public Expr visitColumnReference(ExprNormalizedResult ctx, Stack<Expr> stack, ColumnReferenceExpr expr)
-      throws PlanningException {
+      throws TajoException {
 
     if (ctx.block.isAliasedName(expr.getCanonicalName())) {
       String originalName = ctx.block.getOriginalName(expr.getCanonicalName());


Mime
View raw message