tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [18/18] tajo git commit: TAJO-2007: By default, Optimizer should use the table volume in TableStat.
Date Thu, 28 Jan 2016 16:55:02 GMT
TAJO-2007: By default, Optimizer should use the table volume in TableStat.

Closes #900


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/0c9b6a6e
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/0c9b6a6e
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/0c9b6a6e

Branch: refs/heads/branch-0.11.1
Commit: 0c9b6a6e968bd759f7a38da9a5f62810ea1501b7
Parents: 62fc9f8
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Thu Jan 28 08:48:29 2016 -0800
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Thu Jan 28 08:51:19 2016 -0800

----------------------------------------------------------------------
 CHANGES                                         |   3 +
 .../org/apache/tajo/TajoTestingCluster.java     |   1 +
 .../main/java/org/apache/tajo/SessionVars.java  |   5 +
 .../java/org/apache/tajo/conf/TajoConf.java     |   7 +
 .../apache/tajo/validation/MinValidator.java    |   4 +
 .../apache/tajo/engine/eval/ExprTestBase.java   |   2 +-
 .../engine/planner/TestJoinOrderAlgorithm.java  |  12 +-
 .../engine/planner/TestLogicalOptimizer.java    |   6 +-
 .../tajo/engine/planner/TestLogicalPlanner.java |  10 +-
 .../planner/physical/TestHashAntiJoinExec.java  |   4 +-
 .../planner/physical/TestHashSemiJoinExec.java  |   4 +-
 .../planner/physical/TestPhysicalPlanner.java   |   2 +-
 .../engine/planner/physical/TestSortExec.java   |   4 +-
 .../planner/physical/TestSortIntersectExec.java |   4 +-
 .../apache/tajo/engine/query/TestCrossJoin.java |  21 +-
 .../tajo/engine/query/TestHBaseTable.java       |   2 +-
 .../tajo/engine/query/TestInnerJoinQuery.java   |   1 +
 .../engine/query/TestInnerJoinWithSubQuery.java |  20 +-
 .../query/TestJoinOnPartitionedTables.java      |   2 +-
 .../apache/tajo/engine/query/TestJoinQuery.java |  11 +-
 .../engine/query/TestMultipleJoinTypes.java     |   2 +-
 .../tajo/engine/query/TestOuterJoinQuery.java   |  12 +-
 .../tajo/engine/query/TestSetSessionQuery.java  |  20 +-
 .../tajo/engine/query/TestUnionQuery.java       |  12 +-
 .../tajo/master/TestExecutionBlockCursor.java   |   4 +-
 .../apache/tajo/querymaster/TestKillQuery.java  |   6 +-
 .../queries/TestTablePartitions/case3.sql       |   7 +-
 ...tCrossJoinOfOneSmallTableAndJoin.1.Hash.plan |  92 ++++--
 ...tCrossJoinOfOneSmallTableAndJoin.1.Sort.plan |  92 ++++--
 .../testBroadcastTwoPartJoin.Hash.plan          | 239 +++++++++++-----
 ...stBroadcastTwoPartJoin.Hash_NoBroadcast.plan | 192 ++++++-------
 .../testBroadcastTwoPartJoin.Sort.plan          | 239 +++++++++++-----
 ...stBroadcastTwoPartJoin.Sort_NoBroadcast.plan | 192 ++++++-------
 .../testJoinAsterisk.Hash.plan                  |  18 +-
 .../testJoinAsterisk.Hash_NoBroadcast.plan      |  38 +--
 .../testJoinAsterisk.Sort.plan                  |  18 +-
 .../testJoinAsterisk.Sort_NoBroadcast.plan      |  38 +--
 .../testJoinOnMultipleDatabases.Hash.plan       | 106 +++----
 ...oinOnMultipleDatabases.Hash_NoBroadcast.plan | 202 ++++++-------
 .../testJoinOnMultipleDatabases.Sort.plan       | 106 +++----
 ...oinOnMultipleDatabases.Sort_NoBroadcast.plan | 202 ++++++-------
 .../testJoinWithMultipleJoinQual1.Hash.plan     | 208 +++++++++-----
 ...nWithMultipleJoinQual1.Hash_NoBroadcast.plan | 214 +++++++-------
 .../testJoinWithMultipleJoinQual1.Sort.plan     | 208 +++++++++-----
 ...nWithMultipleJoinQual1.Sort_NoBroadcast.plan | 214 +++++++-------
 .../TestInnerJoinQuery/testTPCHQ2Join.Hash.plan | 212 +++++++++-----
 .../testTPCHQ2Join.Hash_NoBroadcast.plan        | 220 +++++++-------
 .../TestInnerJoinQuery/testTPCHQ2Join.Sort.plan | 212 +++++++++-----
 .../testTPCHQ2Join.Sort_NoBroadcast.plan        | 220 +++++++-------
 .../testWhereClauseJoin5.Hash.plan              | 102 +++++--
 .../testWhereClauseJoin5.Sort.plan              | 102 +++++--
 .../testWhereClauseJoin6.Hash.plan              | 174 +++++++----
 .../testWhereClauseJoin6.Hash_NoBroadcast.plan  | 170 +++++------
 .../testWhereClauseJoin6.Sort.plan              | 174 +++++++----
 .../testWhereClauseJoin6.Sort_NoBroadcast.plan  | 170 +++++------
 .../testBroadcastSubquery.Hash.plan             | 118 ++++++--
 .../testBroadcastSubquery.Sort.plan             | 118 ++++++--
 .../testBroadcastSubquery2.Hash.plan            | 244 +++++++++++-----
 .../testBroadcastSubquery2.Sort.plan            | 244 +++++++++++-----
 .../testJoinWithMultipleJoinQual2.Hash.plan     |  20 +-
 ...nWithMultipleJoinQual2.Hash_NoBroadcast.plan |  54 ++--
 .../testJoinWithMultipleJoinQual2.Sort.plan     |  20 +-
 ...nWithMultipleJoinQual2.Sort_NoBroadcast.plan |  54 ++--
 .../testJoinWithMultipleJoinQual3.Hash.plan     | 127 ++++----
 ...nWithMultipleJoinQual3.Hash_NoBroadcast.plan | 198 ++++++-------
 .../testJoinWithMultipleJoinQual3.Sort.plan     | 127 ++++----
 ...nWithMultipleJoinQual3.Sort_NoBroadcast.plan | 198 ++++++-------
 .../testJoinWithMultipleJoinQual3.result        |   2 +-
 .../testJoinWithMultipleJoinQual4.Hash.plan     | 167 ++++++-----
 ...nWithMultipleJoinQual4.Hash_NoBroadcast.plan | 198 ++++++-------
 .../testJoinWithMultipleJoinQual4.Sort.plan     | 167 ++++++-----
 ...nWithMultipleJoinQual4.Sort_NoBroadcast.plan | 198 ++++++-------
 .../testComplexJoinsWithCaseWhen.Hash.plan      |  71 +++--
 .../testComplexJoinsWithCaseWhen.Sort.plan      |  71 +++--
 .../testComplexJoinsWithCaseWhen2.Hash.plan     |  47 ++-
 .../testComplexJoinsWithCaseWhen2.Sort.plan     |  47 ++-
 .../testInnerAndOuterWithEmpty.1.Hash.plan      |  49 +++-
 .../testInnerAndOuterWithEmpty.1.Sort.plan      |  49 +++-
 .../testJoinWithMultipleJoinTypes.Hash.plan     |  63 ++--
 .../testJoinWithMultipleJoinTypes.Sort.plan     |  63 ++--
 .../testFullOuterJoin1.Hash.plan                |  38 +--
 .../testFullOuterJoin1.Hash_NoBroadcast.plan    |  38 +--
 .../testFullOuterJoin1.Sort.plan                |  38 +--
 .../testFullOuterJoin1.Sort_NoBroadcast.plan    |  38 +--
 .../testLeftOuterJoin1.Hash.plan                |  53 +++-
 .../testLeftOuterJoin1.Sort.plan                |  53 +++-
 .../testLeftOuterJoin2.Hash.plan                |  98 +++++--
 .../testLeftOuterJoin2.Sort.plan                |  98 +++++--
 .../testLeftOuterJoin3.Hash.plan                | 270 ++++++++++++-----
 .../testLeftOuterJoin3.Hash_NoBroadcast.plan    | 240 ++++++++--------
 .../testLeftOuterJoin3.Sort.plan                | 270 ++++++++++++-----
 .../testLeftOuterJoin3.Sort_NoBroadcast.plan    | 240 ++++++++--------
 ...testLeftOuterJoinWithConstantExpr1.Hash.plan |  53 +++-
 ...testLeftOuterJoinWithConstantExpr1.Sort.plan |  53 +++-
 ...testLeftOuterJoinWithConstantExpr4.Hash.plan |  49 +++-
 ...testLeftOuterJoinWithConstantExpr4.Sort.plan |  49 +++-
 ...testLeftOuterJoinWithConstantExpr5.Hash.plan |  47 ++-
 ...testLeftOuterJoinWithConstantExpr5.Sort.plan |  47 ++-
 .../testLeftOuterJoinWithEmptyTable4.Hash.plan  |  57 +++-
 .../testLeftOuterJoinWithEmptyTable4.Sort.plan  |  57 +++-
 .../testLeftOuterJoinWithNull1.Hash.plan        |  53 +++-
 .../testLeftOuterJoinWithNull1.Sort.plan        |  53 +++-
 .../testLeftOuterJoinWithNull2.Hash.plan        |  53 +++-
 .../testLeftOuterJoinWithNull2.Sort.plan        |  53 +++-
 .../testLeftOuterJoinWithNull3.Hash.plan        |  53 +++-
 .../testLeftOuterJoinWithNull3.Sort.plan        |  53 +++-
 ...rJoinWithThetaJoinConditionInWhere.Hash.plan |  43 ++-
 ...rJoinWithThetaJoinConditionInWhere.Sort.plan |  43 ++-
 ...leBroadcastDataFileWithZeroLength2.Hash.plan |  49 +++-
 ...leBroadcastDataFileWithZeroLength2.Sort.plan |  49 +++-
 .../testRightOuterJoin1.Hash.plan               |  53 +++-
 .../testRightOuterJoin1.Sort.plan               |  53 +++-
 ...testLeftOuterJoinWithConstantExpr2.Hash.plan |  69 +++--
 ...testLeftOuterJoinWithConstantExpr2.Sort.plan |  69 +++--
 ...tLeftOuterJoinWithEmptySubquery1.1.Hash.plan |  89 ++++--
 ...tLeftOuterJoinWithEmptySubquery1.1.Sort.plan |  89 ++++--
 .../results/TestSQLAnalyzer/setsession1.result  |   2 +-
 .../results/TestSQLAnalyzer/setsession2.result  |   2 +-
 .../results/TestSQLAnalyzer/setsession3.result  |   2 +-
 .../results/TestSQLAnalyzer/setsession4.result  |   2 +-
 .../results/TestSQLAnalyzer/setsession5.result  |   2 +-
 .../results/TestSQLAnalyzer/setsession6.result  |   2 +-
 .../results/TestSQLAnalyzer/setsession7.result  |   2 +-
 .../results/TestTPCH/testQ2FourJoins.plan       | 222 +++++++-------
 .../resources/results/TestTPCH/testTPCHQ5.plan  | 286 +++++++++----------
 .../TestTajoCli/testHelpSessionVars.result      |   1 +
 .../org/apache/tajo/master/GlobalEngine.java    |   2 +-
 .../org/apache/tajo/parser/sql/SQLAnalyzer.java |   3 +-
 .../tajo/querymaster/QueryMasterTask.java       |   2 +-
 .../org/apache/tajo/plan/LogicalOptimizer.java  |  12 +-
 .../org/apache/tajo/plan/LogicalPlanner.java    |  17 --
 .../rewrite/BaseLogicalPlanRewriteEngine.java   |   1 -
 .../BaseLogicalPlanRewriteRuleProvider.java     |   3 +
 .../rewrite/LogicalPlanRewriteRuleContext.java  |  28 +-
 .../plan/rewrite/TableStatUpdateRewriter.java   | 121 ++++++++
 .../tajo/storage/pgsql/TestPgSQLQueryTests.java |   5 +-
 136 files changed, 6723 insertions(+), 4080 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 78dc0c2..ec607d4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,9 @@ Release 0.11.1 - unreleased
 
   IMPROVEMENT
 
+    TAJO-2007: By default, Optimizer should use the table volume in TableStat.
+    (hyunsik)
+
     TAJO-2061: Add description for EXPLAIN statement. (jaehwa)
 
     TAJO-2060: Upgrade geoip-api-java library. (Byunghwa Yun via jinho)

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-cluster-tests/src/test/java/org/apache/tajo/TajoTestingCluster.java
----------------------------------------------------------------------
diff --git a/tajo-cluster-tests/src/test/java/org/apache/tajo/TajoTestingCluster.java b/tajo-cluster-tests/src/test/java/org/apache/tajo/TajoTestingCluster.java
index 75f410e..5cc5842 100644
--- a/tajo-cluster-tests/src/test/java/org/apache/tajo/TajoTestingCluster.java
+++ b/tajo-cluster-tests/src/test/java/org/apache/tajo/TajoTestingCluster.java
@@ -127,6 +127,7 @@ public class TajoTestingCluster {
     // Injection of equality testing code of logical plan (de)serialization
     conf.setClassVar(ConfVars.LOGICAL_PLAN_REWRITE_RULE_PROVIDER_CLASS, LogicalPlanTestRuleProvider.class);
     conf.setClassVar(ConfVars.GLOBAL_PLAN_REWRITE_RULE_PROVIDER_CLASS, GlobalPlanTestRuleProvider.class);
+    conf.setLongVar(ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD, 1024 * 1024); // 1GB
 
     conf.setInt(ConfVars.WORKER_RESOURCE_AVAILABLE_CPU_CORES.varname, 4);
     conf.setInt(ConfVars.WORKER_RESOURCE_AVAILABLE_MEMORY_MB.varname, 2000);

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-common/src/main/java/org/apache/tajo/SessionVars.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/SessionVars.java b/tajo-common/src/main/java/org/apache/tajo/SessionVars.java
index 8d99a53..ba85549 100644
--- a/tajo-common/src/main/java/org/apache/tajo/SessionVars.java
+++ b/tajo-common/src/main/java/org/apache/tajo/SessionVars.java
@@ -88,6 +88,11 @@ public enum SessionVars implements ConfigKey {
 
   // Query and Optimization ---------------------------------------------------
 
+  // Optimizer
+  USE_TABLE_VOLUME(ConfVars.$USE_TABLE_VOLUME,
+      "Enable optimizer to get and use the table volume via storage handlers", DEFAULT, Boolean.class,
+      Validators.bool()),
+
   // for distributed query strategies
   BROADCAST_NON_CROSS_JOIN_THRESHOLD(ConfVars.$DIST_QUERY_BROADCAST_NON_CROSS_JOIN_THRESHOLD,
       "restriction for the total size of broadcasted table for non-cross join (kb)", DEFAULT, Long.class,

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java b/tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
index 0f80d41..d8cabd1 100644
--- a/tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
+++ b/tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
@@ -319,6 +319,13 @@ public class TajoConf extends Configuration {
 
     // Query and Optimization ---------------------------------------------------
 
+
+    // Enables the optimizer to get and use table volumes via storage handlers.
+    // This feature may cause some performance degradation when storage access is too slow (S3).
+    // By default, this config value is false, and in this case the optimizer uses the table stats from catalog.
+    $USE_TABLE_VOLUME("tajo.optimizer.stats.use-table-volume", Boolean.FALSE),
+
+
     // for distributed query strategies
     $DIST_QUERY_BROADCAST_NON_CROSS_JOIN_THRESHOLD("tajo.dist-query.broadcast.non-cross-join.threshold-kb", 5 * 1024l,
         Validators.min("0")), // 5 MB

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-common/src/main/java/org/apache/tajo/validation/MinValidator.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/validation/MinValidator.java b/tajo-common/src/main/java/org/apache/tajo/validation/MinValidator.java
index 431fe9b..6f249e3 100644
--- a/tajo-common/src/main/java/org/apache/tajo/validation/MinValidator.java
+++ b/tajo-common/src/main/java/org/apache/tajo/validation/MinValidator.java
@@ -67,6 +67,10 @@ public class MinValidator extends AbstractValidator {
         BigDecimal objDecimal = (BigDecimal) object;
         BigDecimal minDecimal = new BigDecimal(minValue);
         result = objDecimal.compareTo(minDecimal) >= 0;
+      } else if (object instanceof String) {
+        BigDecimal objDecimal = new BigDecimal((String)object);
+        BigDecimal minDecimal = new BigDecimal(minValue);
+        result = objDecimal.compareTo(minDecimal) >= 0;
       }
     }
     else {

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
index c0938aa..18d6ba2 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
@@ -108,7 +108,7 @@ public class ExprTestBase {
     analyzer = new SQLAnalyzer();
     preLogicalPlanVerifier = new PreLogicalPlanVerifier(cat);
     planner = new LogicalPlanner(cat, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(util.getConfiguration(), cat);
+    optimizer = new LogicalOptimizer(util.getConfiguration(), cat, TablespaceManager.getInstance());
     annotatedPlanVerifier = new LogicalPlanVerifier();
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestJoinOrderAlgorithm.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestJoinOrderAlgorithm.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestJoinOrderAlgorithm.java
index cf5699f..ad472a4 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestJoinOrderAlgorithm.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestJoinOrderAlgorithm.java
@@ -28,12 +28,15 @@ import org.apache.tajo.catalog.*;
 import org.apache.tajo.catalog.statistics.TableStats;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.engine.function.FunctionLoader;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
-import org.apache.tajo.plan.logical.*;
+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.logical.ScanNode;
 import org.apache.tajo.plan.util.PlannerUtil;
 import org.apache.tajo.storage.TablespaceManager;
 import org.apache.tajo.unit.StorageUnit;
@@ -45,7 +48,8 @@ import org.junit.Test;
 
 import static org.apache.tajo.TajoConstants.DEFAULT_DATABASE_NAME;
 import static org.apache.tajo.TajoConstants.DEFAULT_TABLESPACE_NAME;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 public class TestJoinOrderAlgorithm {
 
@@ -125,7 +129,7 @@ public class TestJoinOrderAlgorithm {
 
     sqlAnalyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    optimizer = new LogicalOptimizer(util.getConfiguration(), catalog, TablespaceManager.getInstance());
 
     defaultContext = LocalTajoTestingUtility.createDummyContext(util.getConfiguration());
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
index b0c5ad1..ea28a80 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
@@ -27,9 +27,9 @@ import org.apache.tajo.catalog.proto.CatalogProtos.FunctionType;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.engine.function.FunctionLoader;
 import org.apache.tajo.engine.function.builtin.SumInt;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.query.QueryContext;
 import org.apache.tajo.exception.TajoException;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -104,10 +104,10 @@ public class TestLogicalOptimizer {
     catalog.createFunction(funcDesc);
     sqlAnalyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    optimizer = new LogicalOptimizer(util.getConfiguration(), catalog, TablespaceManager.getInstance());
 
     defaultContext = LocalTajoTestingUtility.createDummyContext(util.getConfiguration());
-    optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    optimizer = new LogicalOptimizer(util.getConfiguration(), catalog, TablespaceManager.getInstance());
   }
 
   @AfterClass

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
index 116074d..c9fa2ec 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
@@ -512,7 +512,7 @@ public class TestLogicalPlanner {
     Schema expected = tpch.getOutSchema("q2");
     assertSchema(expected, node.getOutSchema());
 
-    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog, TablespaceManager.getInstance());
     optimizer.optimize(plan);
 
     LogicalNode[] nodes = PlannerUtil.findAllNodes(node, NodeType.JOIN);
@@ -551,7 +551,7 @@ public class TestLogicalPlanner {
     LogicalNode node = plan.getRootBlock().getRoot();
     testJsonSerDerObject(node);
 
-    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog, TablespaceManager.getInstance());
     optimizer.optimize(plan);
 
     LogicalNode[] nodes = PlannerUtil.findAllNodes(node, NodeType.SCAN);
@@ -592,7 +592,8 @@ public class TestLogicalPlanner {
     LogicalNode node = plan.getRootBlock().getRoot();
     testJsonSerDerObject(node);
 
-    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog,
+        TablespaceManager.getInstance());
     optimizer.optimize(plan);
 
     LogicalNode[] nodes = PlannerUtil.findAllNodes(node, NodeType.SCAN);
@@ -639,7 +640,8 @@ public class TestLogicalPlanner {
     LogicalNode node = plan.getRootBlock().getRoot();
     testJsonSerDerObject(node);
 
-    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog);
+    LogicalOptimizer optimizer = new LogicalOptimizer(util.getConfiguration(), catalog,
+        TablespaceManager.getInstance());
     optimizer.optimize(plan);
 
     Map<BinaryEval, Boolean> scanMap = TUtil.newHashMap();

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
index 103d2b1..65fcd6a 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 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.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -133,7 +133,7 @@ public class TestHashAntiJoinExec {
     catalog.createTable(people);
     analyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(conf, catalog);
+    optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
index f99dc9e..687eb22 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 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.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -137,7 +137,7 @@ public class TestHashSemiJoinExec {
     catalog.createTable(people);
     analyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(conf, catalog);
+    optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
index 6145b14..fffe2df 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
@@ -166,7 +166,7 @@ public class TestPhysicalPlanner {
     catalog.createTable(score);
     analyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(conf, catalog);
+    optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
     masterPlan = new MasterPlan(LocalTajoTestingUtility.newQueryId(), null, null);
 
     createLargeScoreTable();

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
index 30a63be..2b82793 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
@@ -30,7 +30,6 @@ import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.conf.TajoConf.ConfVars;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.PhysicalPlanner;
 import org.apache.tajo.engine.planner.PhysicalPlannerImpl;
 import org.apache.tajo.engine.planner.RangePartitionAlgorithm;
@@ -38,6 +37,7 @@ import org.apache.tajo.engine.planner.UniformRangePartition;
 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.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -113,7 +113,7 @@ public class TestSortExec {
     queryContext = new QueryContext(conf);
     analyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(conf, catalog);
+    optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
   }
 
   public static String[] QUERIES = {

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
index 66d38b7..501f5b6 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/planner/physical/TestSortIntersectExec.java
@@ -27,12 +27,12 @@ import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.datum.Datum;
 import org.apache.tajo.datum.DatumFactory;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 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.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -141,7 +141,7 @@ public class TestSortIntersectExec {
 
     analyzer = new SQLAnalyzer();
     planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(conf, catalog);
+    optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestCrossJoin.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestCrossJoin.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestCrossJoin.java
index 7990ee7..8be99c9 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestCrossJoin.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestCrossJoin.java
@@ -119,20 +119,35 @@ public class TestCrossJoin extends TestJoinQuery {
 
   @Test (expected = TooLargeInputForCrossJoinException.class)
   public final void testCrossJoinOfOneLargeTableAndJoin() throws Exception {
-    executeString("select * from nation cross join region left outer join lineitem on r_regionkey = l_orderkey inner join supplier on l_suppkey = s_suppkey");
+    try {
+      executeString("SET SESSION BROADCAST_CROSS_JOIN_THRESHOLD to 2").close();
+      executeString("select * from nation cross join region left outer join lineitem on r_regionkey = l_orderkey " +
+          "inner join supplier on l_suppkey = s_suppkey");
+    } finally {
+      executeString("SET SESSION BROADCAST_CROSS_JOIN_THRESHOLD to "
+          + ORIGINAL_BROADCAST_CROSS_JOIN_THRESHOLD).close();
+    }
   }
 
   @Test (expected = TooLargeInputForCrossJoinException.class)
   public final void testCrossJoinOfTwoLargeTables() throws Exception {
-    executeString("select * from nation n1 cross join nation n2");
+    try {
+      executeString("SET SESSION BROADCAST_CROSS_JOIN_THRESHOLD 2").close();
+      executeString("select * from nation n1 cross join nation n2");
+    } finally {
+      executeString("SET SESSION BROADCAST_CROSS_JOIN_THRESHOLD "
+          + ORIGINAL_BROADCAST_CROSS_JOIN_THRESHOLD).close();
+    }
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test (expected = InvalidInputsForCrossJoin.class)
   public final void testCrossJoinOfSubqueries() throws Exception {
     executeString("select * from (select * from nation, region where n_regionkey = r_regionkey) t1 " +
         "cross join (select * from orders, lineitem where l_orderkey = o_orderkey) t2");
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
   @SimpleTest (queries = {
@@ -142,6 +157,7 @@ public class TestCrossJoin extends TestJoinQuery {
     runSimpleTests();
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
   @SimpleTest (queries = {
@@ -152,6 +168,7 @@ public class TestCrossJoin extends TestJoinQuery {
     runSimpleTests();
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
   @SimpleTest (queries = {

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
index 537a9c2..7454927 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestHBaseTable.java
@@ -682,7 +682,7 @@ public class TestHBaseTable extends QueryTestCaseBase {
 
       ResultSet res = executeString("select a.rk, a.col1, a.col2, a.col3, b.l_orderkey, b.l_linestatus " +
           "from hbase_mapped_table a " +
-          "join default.lineitem b on a.col3 = b.l_orderkey");
+          "join default.lineitem b on a.col3 = b.l_orderkey order by a.rk, a.col1, a.col2, a.col3");
       assertResultSet(res);
       res.close();
     } finally {

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinQuery.java
index 1a76f57..42d8b48 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinQuery.java
@@ -259,6 +259,7 @@ public class TestInnerJoinQuery extends TestJoinQuery {
     runSimpleTests();
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
   @SimpleTest()

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinWithSubQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinWithSubQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinWithSubQuery.java
index f987c5f..5a7bfea 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinWithSubQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestInnerJoinWithSubQuery.java
@@ -57,7 +57,7 @@ public class TestInnerJoinWithSubQuery extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest()
   public final void testJoinWithMultipleJoinQual3() throws Exception {
     runSimpleTests();
@@ -71,24 +71,6 @@ public class TestInnerJoinWithSubQuery extends TestJoinQuery {
   }
 
   @Test
-  public final void testJoinWithJson2() throws Exception {
-    /*
-    select t.n_nationkey, t.n_name, t.n_regionkey, t.n_comment, ps.ps_availqty, s.s_suppkey
-    from (
-      select n_nationkey, n_name, n_regionkey, n_comment
-      from nation n
-      join region r on (n.n_regionkey = r.r_regionkey)
-    ) t
-    join supplier s on (s.s_nationkey = t.n_nationkey)
-    join partsupp ps on (s.s_suppkey = ps.ps_suppkey)
-    where t.n_name in ('ARGENTINA','ETHIOPIA', 'MOROCCO');
-     */
-    ResultSet res = executeJsonQuery();
-    assertResultSet(res);
-    cleanupQuery(res);
-  }
-
-  @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
   @SimpleTest(
       prepare = {

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinOnPartitionedTables.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinOnPartitionedTables.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinOnPartitionedTables.java
index bb56434..0d110d1 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinOnPartitionedTables.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinOnPartitionedTables.java
@@ -175,7 +175,7 @@ public class TestJoinOnPartitionedTables extends TestJoinQuery {
       ResultSet res = executeString(
           "select a.l_orderkey as key1, b.l_orderkey as key2 from lineitem as a " +
               "left outer join " + tableName + " b " +
-              "on a.l_partkey = b.l_partkey and b.l_orderkey = 1000"
+              "on a.l_partkey = b.l_partkey and b.l_orderkey = 1000 order by key1, key2"
       );
 
       String expected = "key1,key2\n" +

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
index 7835f99..e9dbedf 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestJoinQuery.java
@@ -54,6 +54,7 @@ import static org.junit.Assert.assertTrue;
 public class TestJoinQuery extends QueryTestCaseBase {
   private static final Log LOG = LogFactory.getLog(TestJoinQuery.class);
   private static int reference = 0;
+  protected static long ORIGINAL_BROADCAST_CROSS_JOIN_THRESHOLD = 1024 * 1024;
 
   public TestJoinQuery(String joinOption) throws Exception {
     super(TajoConstants.DEFAULT_DATABASE_NAME, joinOption);
@@ -62,7 +63,7 @@ public class TestJoinQuery extends QueryTestCaseBase {
     testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_NON_CROSS_JOIN_THRESHOLD.varname,
         "" + 5);
     testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD.varname,
-        "" + 2);
+        1024 * 1024 + "");
 
     testingCluster.setAllTajoDaemonConfValue(
         ConfVars.$EXECUTOR_HASH_JOIN_SIZE_THRESHOLD.varname,
@@ -76,6 +77,8 @@ public class TestJoinQuery extends QueryTestCaseBase {
         ConfVars.$EXECUTOR_GROUPBY_INMEMORY_HASH_THRESHOLD.defaultVal);
 
     if (joinOption.indexOf("NoBroadcast") >= 0) {
+      testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD.varname,
+          1024 * 1024 + "");
       testingCluster.setAllTajoDaemonConfValue(ConfVars.$TEST_BROADCAST_JOIN_ENABLED.varname, "false");
     }
 
@@ -86,6 +89,8 @@ public class TestJoinQuery extends QueryTestCaseBase {
           String.valueOf(256));
       testingCluster.setAllTajoDaemonConfValue(ConfVars.$EXECUTOR_GROUPBY_INMEMORY_HASH_THRESHOLD.varname,
           String.valueOf(256));
+      testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD.varname,
+          1024 * 1024 + "");
     }
     if (joinOption.indexOf("Sort") >= 0) {
       testingCluster.setAllTajoDaemonConfValue(
@@ -94,6 +99,8 @@ public class TestJoinQuery extends QueryTestCaseBase {
           String.valueOf(0));
       testingCluster.setAllTajoDaemonConfValue(ConfVars.$EXECUTOR_GROUPBY_INMEMORY_HASH_THRESHOLD.varname,
           String.valueOf(0));
+      testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD.varname,
+          1024 * 1024 + "");
     }
   }
 
@@ -119,7 +126,7 @@ public class TestJoinQuery extends QueryTestCaseBase {
     testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_NON_CROSS_JOIN_THRESHOLD.varname,
         ConfVars.$DIST_QUERY_BROADCAST_NON_CROSS_JOIN_THRESHOLD.defaultVal);
     testingCluster.setAllTajoDaemonConfValue(ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD.varname,
-        ConfVars.$DIST_QUERY_BROADCAST_CROSS_JOIN_THRESHOLD.defaultVal);
+        1024 * 1024 + "");
 
     testingCluster.setAllTajoDaemonConfValue(
         ConfVars.$EXECUTOR_HASH_JOIN_SIZE_THRESHOLD.varname,

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestMultipleJoinTypes.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestMultipleJoinTypes.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestMultipleJoinTypes.java
index d3cde3d..9c7ac58 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestMultipleJoinTypes.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestMultipleJoinTypes.java
@@ -71,7 +71,7 @@ public class TestMultipleJoinTypes extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest(prepare = {
       "CREATE TABLE customer_broad_parts (" +
           "  c_nationkey INT4," +

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestOuterJoinQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestOuterJoinQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestOuterJoinQuery.java
index 0b42a6d..1ae8bac 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestOuterJoinQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestOuterJoinQuery.java
@@ -81,7 +81,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest()
   public final void testLeftOuterJoinWithConstantExpr4() throws Exception {
     // outer join with constant projections
@@ -95,7 +95,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest()
   public final void testLeftOuterJoinWithConstantExpr5() throws Exception {
     // outer join with constant projections
@@ -116,7 +116,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest()
   public final void testFullOuterJoin1() throws Exception {
     runSimpleTests();
@@ -417,7 +417,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest()
   public final void testLeftOuterJoin2() throws Exception {
     // large, large, small, small
@@ -425,7 +425,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
+  @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest()
   public final void testLeftOuterJoin3() throws Exception {
     // large, large, small, large, small, small
@@ -441,6 +441,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
    runSimpleTests();
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true)
   @SimpleTest
@@ -448,6 +449,7 @@ public class TestOuterJoinQuery extends TestJoinQuery {
     runSimpleTests();
   }
 
+  // FIXME: should be replaced by join queries with hints (See TAJO-2026)
   @Test
   @Option(withExplain = true, withExplainGlobal = true, parameterized = true, sort = true)
   @SimpleTest

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSetSessionQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSetSessionQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSetSessionQuery.java
index 358afbc..05995d2 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSetSessionQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestSetSessionQuery.java
@@ -65,16 +65,16 @@ public class TestSetSessionQuery extends QueryTestCaseBase {
 
   @Test
   public final void testSetSession1() throws Exception {
-    assertFalse(getClient().existSessionVariable("key1"));
-    executeString("SET SESSION key1 to true").close();
-    assertTrue(getClient().existSessionVariable("key1"));
+    assertFalse(getClient().existSessionVariable("KEY1"));
+    executeString("SET SESSION KEY1 to true").close();
+    assertTrue(getClient().existSessionVariable("KEY1"));
 
-    executeString("SET SESSION key1 to true").close();
-    executeString("SET SESSION key2 to 'val1'").close();
-    assertTrue(getClient().existSessionVariable("key1"));
-    assertTrue(getClient().existSessionVariable("key2"));
-    executeString("RESET key1").close();
-    executeString("SET SESSION key2 to DEFAULT").close();
-    assertFalse(getClient().existSessionVariable("key2"));
+    executeString("SET SESSION KEY2 to true").close();
+    executeString("SET SESSION KEY2 to 'val1'").close();
+    assertTrue(getClient().existSessionVariable("KEY1"));
+    assertTrue(getClient().existSessionVariable("KEY2"));
+    executeString("RESET KEY1").close();
+    executeString("SET SESSION KEY2 to DEFAULT").close();
+    assertFalse(getClient().existSessionVariable("KEY2"));
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestUnionQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestUnionQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestUnionQuery.java
index ce22782..7795d39 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestUnionQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/engine/query/TestUnionQuery.java
@@ -545,24 +545,24 @@ public class TestUnionQuery extends QueryTestCaseBase {
   public final void testThreeJoinInUnion() throws Exception {
     // https://issues.apache.org/jira/browse/TAJO-881
     ResultSet res = executeString(
-      "select orders.o_orderkey \n" +
+      "select o_orderkey from (select orders.o_orderkey \n" +
           "from orders\n" +
           "join lineitem on orders.o_orderkey = lineitem.l_orderkey\n" +
           "join customer on orders.o_custkey =  customer.c_custkey\n" +
           "union all \n" +
-          "select nation.n_nationkey from nation"
+          "select nation.n_nationkey from nation) t order by o_orderkey"
     );
     String expected =
         "o_orderkey\n" +
             "-------------------------------\n" +
+            "0\n" +
+            "1\n" +
             "1\n" +
             "1\n" +
             "2\n" +
+            "2\n" +
             "3\n" +
             "3\n" +
-            "0\n" +
-            "1\n" +
-            "2\n" +
             "3\n" +
             "4\n" +
             "5\n" +
@@ -685,7 +685,7 @@ public class TestUnionQuery extends QueryTestCaseBase {
   }
 
   @Test
-  @Option(withExplain = true, withExplainGlobal = true)
+  @Option(withExplain = true, withExplainGlobal = true, sort = true)
   @SimpleTest
   public void testComplexUnion2() throws Exception {
     runSimpleTests();

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java b/tajo-core-tests/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
index 578b278..4e79334 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
@@ -25,12 +25,12 @@ import org.apache.tajo.catalog.TableDesc;
 import org.apache.tajo.catalog.TableMeta;
 import org.apache.tajo.catalog.statistics.TableStats;
 import org.apache.tajo.conf.TajoConf;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.global.ExecutionBlock;
 import org.apache.tajo.engine.planner.global.ExecutionBlockCursor;
 import org.apache.tajo.engine.planner.global.GlobalPlanner;
 import org.apache.tajo.engine.planner.global.MasterPlan;
 import org.apache.tajo.engine.query.QueryContext;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -80,7 +80,7 @@ public class TestExecutionBlockCursor {
 
     analyzer = new SQLAnalyzer();
     logicalPlanner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    optimizer = new LogicalOptimizer(conf, catalog);
+    optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
 
     dispatcher = new AsyncDispatcher();
     dispatcher.init(conf);

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/java/org/apache/tajo/querymaster/TestKillQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/java/org/apache/tajo/querymaster/TestKillQuery.java b/tajo-core-tests/src/test/java/org/apache/tajo/querymaster/TestKillQuery.java
index 5c0b11d..7b32ad6 100644
--- a/tajo-core-tests/src/test/java/org/apache/tajo/querymaster/TestKillQuery.java
+++ b/tajo-core-tests/src/test/java/org/apache/tajo/querymaster/TestKillQuery.java
@@ -29,7 +29,6 @@ import org.apache.tajo.catalog.CatalogService;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.client.TajoClient;
 import org.apache.tajo.conf.TajoConf;
-import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.engine.planner.global.GlobalPlanner;
 import org.apache.tajo.engine.planner.global.MasterPlan;
 import org.apache.tajo.engine.query.QueryContext;
@@ -39,6 +38,7 @@ import org.apache.tajo.master.event.QueryEvent;
 import org.apache.tajo.master.event.QueryEventType;
 import org.apache.tajo.master.event.StageEvent;
 import org.apache.tajo.master.event.StageEventType;
+import org.apache.tajo.parser.sql.SQLAnalyzer;
 import org.apache.tajo.plan.LogicalOptimizer;
 import org.apache.tajo.plan.LogicalPlan;
 import org.apache.tajo.plan.LogicalPlanner;
@@ -96,7 +96,7 @@ public class TestKillQuery {
     CatalogService catalog = cluster.getMaster().getCatalog();
 
     LogicalPlanner planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    LogicalOptimizer optimizer = new LogicalOptimizer(conf, catalog);
+    LogicalOptimizer optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
     Expr expr =  analyzer.parse(queryStr);
     LogicalPlan plan = planner.createPlan(defaultContext, expr);
 
@@ -160,7 +160,7 @@ public class TestKillQuery {
     CatalogService catalog = cluster.getMaster().getCatalog();
 
     LogicalPlanner planner = new LogicalPlanner(catalog, TablespaceManager.getInstance());
-    LogicalOptimizer optimizer = new LogicalOptimizer(conf, catalog);
+    LogicalOptimizer optimizer = new LogicalOptimizer(conf, catalog, TablespaceManager.getInstance());
     Expr expr =  analyzer.parse(queryStr);
     LogicalPlan plan = planner.createPlan(defaultContext, expr);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/resources/queries/TestTablePartitions/case3.sql
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/queries/TestTablePartitions/case3.sql b/tajo-core-tests/src/test/resources/queries/TestTablePartitions/case3.sql
index 6cb1ea1..0164d4c 100644
--- a/tajo-core-tests/src/test/resources/queries/TestTablePartitions/case3.sql
+++ b/tajo-core-tests/src/test/resources/queries/TestTablePartitions/case3.sql
@@ -4,5 +4,10 @@ select
   key
   from lineitem as l, testQueryCasesOnColumnPartitionedTable as p
 where
-  (key = 45.0 or key = 38.0) and l.l_orderkey = p.col1;
+  (key = 45.0 or key = 38.0) and l.l_orderkey = p.col1
+order by
+   l.l_orderkey,
+   p.col1,
+   key
+
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/0c9b6a6e/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinOfOneSmallTableAndJoin.1.Hash.plan
----------------------------------------------------------------------
diff --git a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinOfOneSmallTableAndJoin.1.Hash.plan b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinOfOneSmallTableAndJoin.1.Hash.plan
index 36a1b43..d43ff32 100644
--- a/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinOfOneSmallTableAndJoin.1.Hash.plan
+++ b/tajo-core-tests/src/test/resources/results/TestCrossJoin/testCrossJoinOfOneSmallTableAndJoin.1.Hash.plan
@@ -37,21 +37,90 @@ Execution Block Graph (TERMINAL - eb_0000000000000_0000_000008)
 -------------------------------------------------------------------------------
 |-eb_0000000000000_0000_000008
    |-eb_0000000000000_0000_000007
+      |-eb_0000000000000_0000_000004
+      |-eb_0000000000000_0000_000003
+         |-eb_0000000000000_0000_000002
+         |-eb_0000000000000_0000_000001
 -------------------------------------------------------------------------------
 Order of Execution
 -------------------------------------------------------------------------------
-1: eb_0000000000000_0000_000007
-2: eb_0000000000000_0000_000008
+1: eb_0000000000000_0000_000001
+2: eb_0000000000000_0000_000002
+3: eb_0000000000000_0000_000003
+4: eb_0000000000000_0000_000004
+5: eb_0000000000000_0000_000007
+6: eb_0000000000000_0000_000008
 -------------------------------------------------------------------------------
 
 =======================================================
+Block Id: eb_0000000000000_0000_000001 [LEAF]
+=======================================================
+
+[Outgoing]
+[q_0000000000000_0000] 1 => 3 (type=HASH_SHUFFLE, key=default.region.r_regionkey (INT4), num=32)
+
+SCAN(1) on default.region
+  => target list: default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
+  => out schema: {(3) default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
+  => in schema: {(3) default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
+
+=======================================================
+Block Id: eb_0000000000000_0000_000002 [LEAF]
+=======================================================
+
+[Outgoing]
+[q_0000000000000_0000] 2 => 3 (type=HASH_SHUFFLE, key=default.lineitem.l_orderkey (INT4), num=32)
+
+SCAN(3) on default.lineitem
+  => target list: default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)
+  => out schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
+  => in schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
+
+=======================================================
+Block Id: eb_0000000000000_0000_000003 [INTERMEDIATE]
+=======================================================
+
+[Incoming]
+[q_0000000000000_0000] 1 => 3 (type=HASH_SHUFFLE, key=default.region.r_regionkey (INT4), num=32)
+[q_0000000000000_0000] 2 => 3 (type=HASH_SHUFFLE, key=default.lineitem.l_orderkey (INT4), num=32)
+
+[Outgoing]
+[q_0000000000000_0000] 3 => 7 (type=HASH_SHUFFLE, key=default.lineitem.l_suppkey (INT4), num=32)
+
+JOIN(9)(LEFT_OUTER)
+  => Join Cond: default.region.r_regionkey (INT4) = default.lineitem.l_orderkey (INT4)
+  => target list: default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
+  => out schema: {(19) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
+  => in schema: {(19) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
+   SCAN(14) on eb_0000000000000_0000_000002
+     => out schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
+     => in schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
+   SCAN(13) on eb_0000000000000_0000_000001
+     => out schema: {(3) default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
+     => in schema: {(3) default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
+
+=======================================================
+Block Id: eb_0000000000000_0000_000004 [LEAF]
+=======================================================
+
+[Outgoing]
+[q_0000000000000_0000] 4 => 7 (type=HASH_SHUFFLE, key=default.supplier.s_suppkey (INT4), num=32)
+
+SCAN(5) on default.supplier
+  => target list: default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)
+  => out schema: {(7) default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)}
+  => in schema: {(7) default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)}
+
+=======================================================
 Block Id: eb_0000000000000_0000_000007 [ROOT]
 =======================================================
 
+[Incoming]
+[q_0000000000000_0000] 3 => 7 (type=HASH_SHUFFLE, key=default.lineitem.l_suppkey (INT4), num=32)
+[q_0000000000000_0000] 4 => 7 (type=HASH_SHUFFLE, key=default.supplier.s_suppkey (INT4), num=32)
+
 [Enforcers]
  0: type=Broadcast, tables=default.orders
- 1: type=Broadcast, tables=default.region
- 2: type=Broadcast, tables=default.supplier
 
 JOIN(11)(CROSS)
   => target list: default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.orders.o_clerk (TEXT), default.orders.o_comment (TEXT), default.orders.o_custkey (INT4), default.orders.o_orderdate (TEXT), default.orders.o_orderkey (INT4), default.orders.o_orderpriority (TEXT), default.orders.o_orderstatus (TEXT), default.orders.o_shippriority (INT4), default.orders.o_totalprice (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), de
 fault.region.r_regionkey (INT4), default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)
@@ -66,23 +135,12 @@ JOIN(11)(CROSS)
      => target list: default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)
      => out schema: {(26) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)}
      => in schema: {(26) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4), default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)}
-      SCAN(5) on default.supplier
-        => target list: default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)
+      SCAN(16) on eb_0000000000000_0000_000004
         => out schema: {(7) default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)}
         => in schema: {(7) default.supplier.s_acctbal (FLOAT8), default.supplier.s_address (TEXT), default.supplier.s_comment (TEXT), default.supplier.s_name (TEXT), default.supplier.s_nationkey (INT4), default.supplier.s_phone (TEXT), default.supplier.s_suppkey (INT4)}
-      JOIN(9)(LEFT_OUTER)
-        => Join Cond: default.region.r_regionkey (INT4) = default.lineitem.l_orderkey (INT4)
-        => target list: default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
+      SCAN(15) on eb_0000000000000_0000_000003
         => out schema: {(19) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
         => in schema: {(19) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8), default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
-         SCAN(3) on default.lineitem
-           => target list: default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)
-           => out schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
-           => in schema: {(16) default.lineitem.l_comment (TEXT), default.lineitem.l_commitdate (TEXT), default.lineitem.l_discount (FLOAT8), default.lineitem.l_extendedprice (FLOAT8), default.lineitem.l_linenumber (INT4), default.lineitem.l_linestatus (TEXT), default.lineitem.l_orderkey (INT4), default.lineitem.l_partkey (INT4), default.lineitem.l_quantity (FLOAT8), default.lineitem.l_receiptdate (TEXT), default.lineitem.l_returnflag (TEXT), default.lineitem.l_shipdate (TEXT), default.lineitem.l_shipinstruct (TEXT), default.lineitem.l_shipmode (TEXT), default.lineitem.l_suppkey (INT4), default.lineitem.l_tax (FLOAT8)}
-         SCAN(1) on default.region
-           => target list: default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)
-           => out schema: {(3) default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
-           => in schema: {(3) default.region.r_comment (TEXT), default.region.r_name (TEXT), default.region.r_regionkey (INT4)}
 
 =======================================================
 Block Id: eb_0000000000000_0000_000008 [TERMINAL]


Mime
View raw message