You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by ji...@apache.org on 2015/05/25 16:36:50 UTC

[57/57] [abbrv] tajo git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into index_support

Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/tajo into index_support


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

Branch: refs/heads/index_support
Commit: 4d01fca9972207e045218ea7a39ac2cbbbea2e0c
Parents: 1ad6b6c bbfa076
Author: Jihoon Son <ji...@apache.org>
Authored: Mon May 25 23:28:21 2015 +0900
Committer: Jihoon Son <ji...@apache.org>
Committed: Mon May 25 23:28:21 2015 +0900

----------------------------------------------------------------------
 CHANGES                                         |   18 +-
 .../InfoSchemaMetadataDictionary.java           |    2 +
 .../dictionary/SessionTableDescriptor.java      |   45 +
 .../engine/planner/PhysicalPlannerImpl.java     |    8 +-
 .../planner/physical/ColPartitionStoreExec.java |    2 +-
 .../physical/PartitionMergeScanExec.java        |   27 +-
 .../planner/physical/PhysicalPlanUtil.java      |    4 +-
 .../physical/RangeShuffleFileWriteExec.java     |    2 +-
 .../engine/planner/physical/SeqScanExec.java    |    7 +-
 .../engine/planner/physical/StoreTableExec.java |    2 +-
 .../org/apache/tajo/master/GlobalEngine.java    |    4 +-
 .../java/org/apache/tajo/master/TajoMaster.java |    6 +-
 .../apache/tajo/master/exec/DDLExecutor.java    |    6 +-
 .../exec/ExplainPlanPreprocessorForTest.java    |  137 +-
 .../exec/NonForwardQueryResultFileScanner.java  |   16 +-
 .../NonForwardQueryResultSystemScanner.java     |   32 +-
 .../apache/tajo/master/exec/QueryExecutor.java  |    4 +-
 .../tajo/querymaster/QueryMasterTask.java       |    4 +-
 .../apache/tajo/querymaster/Repartitioner.java  |   32 +-
 .../java/org/apache/tajo/querymaster/Stage.java |   12 +-
 .../org/apache/tajo/session/SessionManager.java |    2 +
 .../org/apache/tajo/worker/TajoQueryEngine.java |    1 -
 .../main/java/org/apache/tajo/worker/Task.java  |    2 +-
 .../apache/tajo/ws/rs/ClientApplication.java    |    6 +-
 .../org/apache/tajo/BackendTestingUtil.java     |    2 +-
 .../test/java/org/apache/tajo/NamedTest.java    |   27 +
 .../java/org/apache/tajo/QueryTestCaseBase.java |  195 ++-
 .../org/apache/tajo/TajoTestingCluster.java     |   20 +-
 .../engine/function/TestBuiltinFunctions.java   |  132 +-
 .../planner/global/TestBroadcastJoinPlan.java   | 1044 ---------------
 .../planner/physical/TestBNLJoinExec.java       |   12 +-
 .../planner/physical/TestExternalSortExec.java  |    4 +-
 .../physical/TestFullOuterHashJoinExec.java     |   24 +-
 .../physical/TestFullOuterMergeJoinExec.java    |   38 +-
 .../planner/physical/TestHashAntiJoinExec.java  |    8 +-
 .../planner/physical/TestHashJoinExec.java      |   12 +-
 .../planner/physical/TestHashSemiJoinExec.java  |    8 +-
 .../physical/TestLeftOuterHashJoinExec.java     |   28 +-
 .../planner/physical/TestMergeJoinExec.java     |    8 +-
 .../engine/planner/physical/TestNLJoinExec.java |   12 +-
 .../planner/physical/TestPhysicalPlanner.java   |   56 +-
 .../physical/TestProgressExternalSortExec.java  |    4 +-
 .../physical/TestRightOuterHashJoinExec.java    |   18 +-
 .../physical/TestRightOuterMergeJoinExec.java   |   36 +-
 .../engine/planner/physical/TestSortExec.java   |    8 +-
 .../tajo/engine/query/TestGroupByQuery.java     |   34 +-
 .../tajo/engine/query/TestHBaseTable.java       |   22 +-
 .../tajo/engine/query/TestInnerJoinQuery.java   |  335 +++++
 .../engine/query/TestInnerJoinWithSubQuery.java |  125 ++
 .../tajo/engine/query/TestJoinBroadcast.java    |  850 ------------
 .../query/TestJoinOnPartitionedTables.java      |  337 ++++-
 .../apache/tajo/engine/query/TestJoinQuery.java | 1241 +++--------------
 .../engine/query/TestMultipleJoinTypes.java     |  105 ++
 .../tajo/engine/query/TestOuterJoinQuery.java   |  462 +++++++
 .../engine/query/TestOuterJoinWithSubQuery.java |  142 ++
 .../tajo/engine/query/TestSelectQuery.java      |   45 +-
 .../apache/tajo/engine/query/TestSortQuery.java |   14 +-
 .../org/apache/tajo/jdbc/TestResultSet.java     |    4 +-
 .../tajo/master/TestExecutionBlockCursor.java   |    4 +-
 .../TestNonForwardQueryResultSystemScanner.java |    1 +
 .../org/apache/tajo/storage/TestRowFile.java    |    4 +-
 .../customer_large/customer.tbl                 |  100 --
 .../lineitem_large/lineitem.tbl                 |   97 --
 .../TestJoinBroadcast/orders_large/orders.tbl   |  300 -----
 .../testDistinctAggregationCaseByCase4.sql      |    2 +-
 .../testGroupByWithNullData5.sql                |    2 +-
 .../testGroupByWithNullData6.sql                |    2 +-
 .../testGroupByWithNullData7.sql                |    2 +-
 .../testGroupByWithNullData8.sql                |    2 +-
 .../testBroadcastTwoPartJoin.sql                |   19 +
 .../testCrossJoinAndCaseWhen.sql                |   18 +
 .../testCrossJoinWithAsterisk1.sql              |    1 +
 .../testCrossJoinWithAsterisk2.sql              |    1 +
 .../testCrossJoinWithAsterisk3.sql              |    1 +
 .../testCrossJoinWithAsterisk4.sql              |    1 +
 .../testBroadcastSubquery.sql                   |   12 +
 .../testBroadcastSubquery2.sql                  |   19 +
 .../create_customer_large_ddl.sql               |    7 -
 .../create_lineitem_large_ddl.sql               |    7 -
 .../create_orders_large_ddl.sql                 |    7 -
 .../customer_partition_ddl.sql                  |    9 -
 .../insert_into_customer_partition.sql          |   11 -
 .../TestJoinBroadcast/nation_multifile_ddl.sql  |    5 -
 .../queries/TestJoinBroadcast/oj_table1_ddl.sql |    6 -
 .../queries/TestJoinBroadcast/oj_table2_ddl.sql |    6 -
 .../TestJoinBroadcast/orders_multifile_ddl.sql  |    5 -
 .../testBroadcastBasicJoin.sql                  |   11 -
 .../testBroadcastPartitionTable.sql             |   16 -
 .../TestJoinBroadcast/testBroadcastSubquery.sql |   12 -
 .../testBroadcastSubquery2.sql                  |   19 -
 .../testBroadcastTwoPartJoin.sql                |   15 -
 .../queries/TestJoinBroadcast/testCrossJoin.sql |    1 -
 .../testCrossJoinAndCaseWhen.sql                |   18 -
 .../testCrossJoinWithAsterisk1.sql              |    1 -
 .../testCrossJoinWithAsterisk2.sql              |    1 -
 .../testCrossJoinWithAsterisk3.sql              |    1 -
 .../testCrossJoinWithAsterisk4.sql              |    1 -
 .../testCrossJoinWithEmptyTable1.sql            |    8 -
 .../TestJoinBroadcast/testFullOuterJoin1.sql    |    8 -
 .../testFullOuterJoinWithEmptyTable1.sql        |    8 -
 .../testInnerJoinWithEmptyTable.sql             |    8 -
 .../testJoinCoReferredEvals1.sql                |   11 -
 .../testJoinCoReferredEvalsWithSameExprs1.sql   |   14 -
 .../testJoinCoReferredEvalsWithSameExprs2.sql   |   22 -
 .../testJoinOnMultipleDatabases.sql             |   25 -
 .../TestJoinBroadcast/testLeftOuterJoin1.sql    |    9 -
 .../TestJoinBroadcast/testLeftOuterJoin2.sql    |    5 -
 .../TestJoinBroadcast/testLeftOuterJoin3.sql    |    7 -
 .../testLeftOuterJoinWithConstantExpr1.sql      |    9 -
 .../testLeftOuterJoinWithConstantExpr2.sql      |    9 -
 .../testLeftOuterJoinWithConstantExpr3.sql      |   17 -
 .../testLeftOuterJoinWithEmptyTable1.sql        |    9 -
 .../testLeftOuterJoinWithEmptyTable2.sql        |    9 -
 .../testLeftOuterJoinWithEmptyTable3.sql        |   14 -
 .../testLeftOuterJoinWithEmptyTable4.sql        |   17 -
 ...tMultipleBroadcastDataFileWithZeroLength.sql |    3 -
 ...MultipleBroadcastDataFileWithZeroLength2.sql |    5 -
 ...rtitionedBroadcastDataFileWithZeroLength.sql |    3 -
 ...titionedBroadcastDataFileWithZeroLength2.sql |    5 -
 .../testOuterJoinAndCaseWhen1.sql               |   12 -
 .../TestJoinBroadcast/testRightOuterJoin1.sql   |    8 -
 .../testRightOuterJoinWithEmptyTable1.sql       |    8 -
 .../TestJoinBroadcast/testTPCHQ2Join.sql        |   25 -
 .../TestJoinBroadcast/testWhereClauseJoin1.sql  |   10 -
 .../TestJoinBroadcast/testWhereClauseJoin2.sql  |    8 -
 .../TestJoinBroadcast/testWhereClauseJoin3.sql  |    9 -
 .../TestJoinBroadcast/testWhereClauseJoin4.sql  |    8 -
 .../TestJoinBroadcast/testWhereClauseJoin5.sql  |   15 -
 .../TestJoinBroadcast/testWhereClauseJoin6.sql  |   19 -
 .../customer_ddl.sql                            |    9 -
 .../insert_into_customer.sql                    |   11 -
 .../testBroadcastPartitionTable.sql             |   16 +
 ...rtitionedBroadcastDataFileWithZeroLength.sql |    3 +
 ...titionedBroadcastDataFileWithZeroLength2.sql |    5 +
 .../TestJoinQuery/create_customer_large_ddl.sql |    7 +
 .../TestJoinQuery/create_lineitem_large_ddl.sql |    7 +
 .../TestJoinQuery/create_orders_large_ddl.sql   |    7 +
 .../TestJoinQuery/customer_partition_ddl.sql    |    9 +
 .../TestJoinQuery/insert_into_customer.sql      |   11 +
 .../insert_into_customer_partition.sql          |   11 +
 .../TestJoinQuery/nation_multifile_ddl.sql      |    5 +
 .../queries/TestJoinQuery/oj_table1_ddl.sql     |    2 +-
 .../queries/TestJoinQuery/oj_table2_ddl.sql     |    2 +-
 .../TestJoinQuery/orders_multifile_ddl.sql      |    5 +
 .../TestJoinQuery/partitioned_customer_ddl.sql  |   19 +
 .../queries/TestJoinQuery/testCrossJoin.sql     |    1 -
 .../testCrossJoinWithAsterisk1.sql              |    1 -
 .../testCrossJoinWithAsterisk2.sql              |    1 -
 .../testCrossJoinWithAsterisk3.sql              |    1 -
 .../testCrossJoinWithAsterisk4.sql              |    1 -
 .../TestJoinQuery/testOuterJoinAndCaseWhen1.sql |    2 +-
 .../TestOuterJoinQuery/testLeftOuterJoin2.sql   |    5 +
 .../TestOuterJoinQuery/testLeftOuterJoin3.sql   |    7 +
 ...tMultipleBroadcastDataFileWithZeroLength.sql |    3 +
 ...MultipleBroadcastDataFileWithZeroLength2.sql |    5 +
 .../testSelectOnSessionTable.sql                |    1 +
 .../create_table_with_date_ddl.sql              |    2 +-
 .../queries/TestSortQuery/testSortWithDate.sql  |    2 +-
 .../testBroadcastTwoPartJoin.Hash.plan          |  168 +++
 ...stBroadcastTwoPartJoin.Hash_NoBroadcast.plan |  249 ++++
 .../testBroadcastTwoPartJoin.Sort.plan          |  168 +++
 ...stBroadcastTwoPartJoin.Sort_NoBroadcast.plan |  249 ++++
 .../testBroadcastTwoPartJoin.result             |    7 +
 .../testComplexJoinCondition1.Hash.plan         |   79 ++
 ...tComplexJoinCondition1.Hash_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition1.Sort.plan         |   79 ++
 ...tComplexJoinCondition1.Sort_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition1.result            |   27 +
 .../testComplexJoinCondition2.Hash.plan         |   79 ++
 ...tComplexJoinCondition2.Hash_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition2.Sort.plan         |   79 ++
 ...tComplexJoinCondition2.Sort_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition2.result            |   27 +
 .../testComplexJoinCondition3.Hash.plan         |   79 ++
 ...tComplexJoinCondition3.Hash_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition3.Sort.plan         |   79 ++
 ...tComplexJoinCondition3.Sort_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition3.result            |   27 +
 .../testComplexJoinCondition4.Hash.plan         |   79 ++
 ...tComplexJoinCondition4.Hash_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition4.Sort.plan         |   79 ++
 ...tComplexJoinCondition4.Sort_NoBroadcast.plan |  105 ++
 .../testComplexJoinCondition4.result            |   29 +
 .../testCrossJoin.1.Hash.plan                   |   77 ++
 .../testCrossJoin.1.Hash_NoBroadcast.plan       |  103 ++
 .../testCrossJoin.1.Sort.plan                   |   77 ++
 .../testCrossJoin.1.Sort_NoBroadcast.plan       |  103 ++
 .../TestInnerJoinQuery/testCrossJoin.1.result   |  127 ++
 .../testCrossJoin.2.Hash.plan                   |   52 +
 .../testCrossJoin.2.Hash_NoBroadcast.plan       |   78 ++
 .../testCrossJoin.2.Sort.plan                   |   52 +
 .../testCrossJoin.2.Sort_NoBroadcast.plan       |   78 ++
 .../TestInnerJoinQuery/testCrossJoin.2.result   |   27 +
 .../testCrossJoin.3.Hash.plan                   |   52 +
 .../testCrossJoin.3.Hash_NoBroadcast.plan       |   78 ++
 .../testCrossJoin.3.Sort.plan                   |   52 +
 .../testCrossJoin.3.Sort_NoBroadcast.plan       |   78 ++
 .../TestInnerJoinQuery/testCrossJoin.3.result   |   27 +
 .../testCrossJoin.4.Hash.plan                   |   52 +
 .../testCrossJoin.4.Hash_NoBroadcast.plan       |   78 ++
 .../testCrossJoin.4.Sort.plan                   |   52 +
 .../testCrossJoin.4.Sort_NoBroadcast.plan       |   78 ++
 .../TestInnerJoinQuery/testCrossJoin.4.result   |   27 +
 .../testCrossJoin.5.Hash.plan                   |   77 ++
 .../testCrossJoin.5.Hash_NoBroadcast.plan       |  103 ++
 .../testCrossJoin.5.Sort.plan                   |   77 ++
 .../testCrossJoin.5.Sort_NoBroadcast.plan       |  103 ++
 .../TestInnerJoinQuery/testCrossJoin.5.result   |   27 +
 .../testCrossJoinAndCaseWhen.Hash.plan          |   79 ++
 ...stCrossJoinAndCaseWhen.Hash_NoBroadcast.plan |  105 ++
 .../testCrossJoinAndCaseWhen.Sort.plan          |   79 ++
 ...stCrossJoinAndCaseWhen.Sort_NoBroadcast.plan |  105 ++
 .../testCrossJoinAndCaseWhen.result             |   27 +
 .../testCrossJoinWithAsterisk1.Hash.plan        |   77 ++
 ...CrossJoinWithAsterisk1.Hash_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk1.Sort.plan        |   77 ++
 ...CrossJoinWithAsterisk1.Sort_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk1.result           |   27 +
 .../testCrossJoinWithAsterisk2.Hash.plan        |   77 ++
 ...CrossJoinWithAsterisk2.Hash_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk2.Sort.plan        |   77 ++
 ...CrossJoinWithAsterisk2.Sort_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk2.result           |   27 +
 .../testCrossJoinWithAsterisk3.Hash.plan        |   77 ++
 ...CrossJoinWithAsterisk3.Hash_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk3.Sort.plan        |   77 ++
 ...CrossJoinWithAsterisk3.Sort_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk3.result           |   27 +
 .../testCrossJoinWithAsterisk4.Hash.plan        |   77 ++
 ...CrossJoinWithAsterisk4.Hash_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk4.Sort.plan        |   77 ++
 ...CrossJoinWithAsterisk4.Sort_NoBroadcast.plan |  103 ++
 .../testCrossJoinWithAsterisk4.result           |   27 +
 .../testCrossJoinWithEmptyTable1.Hash.plan      |   79 ++
 ...ossJoinWithEmptyTable1.Hash_NoBroadcast.plan |  105 ++
 .../testCrossJoinWithEmptyTable1.Sort.plan      |   79 ++
 ...ossJoinWithEmptyTable1.Sort_NoBroadcast.plan |  105 ++
 .../testCrossJoinWithEmptyTable1.result         |    2 +
 ...sJoinWithThetaJoinConditionInWhere.Hash.plan |   64 +
 ...taJoinConditionInWhere.Hash_NoBroadcast.plan |   90 ++
 ...sJoinWithThetaJoinConditionInWhere.Sort.plan |   64 +
 ...taJoinConditionInWhere.Sort_NoBroadcast.plan |   90 ++
 ...rossJoinWithThetaJoinConditionInWhere.result |   12 +
 .../testDifferentTypesJoinCondition.Hash.plan   |   54 +
 ...rentTypesJoinCondition.Hash_NoBroadcast.plan |   80 ++
 .../testDifferentTypesJoinCondition.Sort.plan   |   54 +
 ...rentTypesJoinCondition.Sort_NoBroadcast.plan |   80 ++
 .../testDifferentTypesJoinCondition.result      |    7 +
 .../testInnerJoinAndCaseWhen.Hash.plan          |   79 ++
 ...stInnerJoinAndCaseWhen.Hash_NoBroadcast.plan |  105 ++
 .../testInnerJoinAndCaseWhen.Sort.plan          |   79 ++
 ...stInnerJoinAndCaseWhen.Sort_NoBroadcast.plan |  105 ++
 .../testInnerJoinAndCaseWhen.result             |   27 +
 .../testInnerJoinWithEmptyTable.Hash.plan       |   79 ++
 ...nnerJoinWithEmptyTable.Hash_NoBroadcast.plan |  105 ++
 .../testInnerJoinWithEmptyTable.Sort.plan       |   79 ++
 ...nnerJoinWithEmptyTable.Sort_NoBroadcast.plan |  105 ++
 .../testInnerJoinWithEmptyTable.result          |    2 +
 ...rJoinWithThetaJoinConditionInWhere.Hash.plan |   58 +
 ...taJoinConditionInWhere.Hash_NoBroadcast.plan |   84 ++
 ...rJoinWithThetaJoinConditionInWhere.Sort.plan |   58 +
 ...taJoinConditionInWhere.Sort_NoBroadcast.plan |   84 ++
 ...nnerJoinWithThetaJoinConditionInWhere.result |    7 +
 .../testJoinAsterisk.Hash.plan                  |   54 +
 .../testJoinAsterisk.Hash_NoBroadcast.plan      |   80 ++
 .../testJoinAsterisk.Sort.plan                  |   54 +
 .../testJoinAsterisk.Sort_NoBroadcast.plan      |   80 ++
 .../TestInnerJoinQuery/testJoinAsterisk.result  |    7 +
 .../testJoinCoReferredEvals1.Hash.plan          |   79 ++
 ...stJoinCoReferredEvals1.Hash_NoBroadcast.plan |  105 ++
 .../testJoinCoReferredEvals1.Sort.plan          |   79 ++
 ...stJoinCoReferredEvals1.Sort_NoBroadcast.plan |  105 ++
 .../testJoinCoReferredEvals1.result             |   27 +
 ...tJoinCoReferredEvalsWithSameExprs1.Hash.plan |   89 ++
 ...redEvalsWithSameExprs1.Hash_NoBroadcast.plan |  115 ++
 ...tJoinCoReferredEvalsWithSameExprs1.Sort.plan |   89 ++
 ...redEvalsWithSameExprs1.Sort_NoBroadcast.plan |  115 ++
 ...testJoinCoReferredEvalsWithSameExprs1.result |   22 +
 ...tJoinCoReferredEvalsWithSameExprs2.Hash.plan |  120 ++
 ...redEvalsWithSameExprs2.Hash_NoBroadcast.plan |  146 ++
 ...tJoinCoReferredEvalsWithSameExprs2.Sort.plan |  120 ++
 ...redEvalsWithSameExprs2.Sort_NoBroadcast.plan |  146 ++
 ...testJoinCoReferredEvalsWithSameExprs2.result |   22 +
 .../testJoinOnMultipleDatabases.Hash.plan       |  168 +++
 ...oinOnMultipleDatabases.Hash_NoBroadcast.plan |  249 ++++
 .../testJoinOnMultipleDatabases.Sort.plan       |  168 +++
 ...oinOnMultipleDatabases.Sort_NoBroadcast.plan |  249 ++++
 .../testJoinOnMultipleDatabases.result          |    5 +
 .../testJoinOnMultipleDatabasesWithJson.result  |    5 +
 .../TestInnerJoinQuery/testJoinWithJson.result  |   27 +
 .../testJoinWithMultipleJoinQual1.Hash.plan     |  168 +++
 ...nWithMultipleJoinQual1.Hash_NoBroadcast.plan |  249 ++++
 .../testJoinWithMultipleJoinQual1.Sort.plan     |  168 +++
 ...nWithMultipleJoinQual1.Sort_NoBroadcast.plan |  249 ++++
 .../testJoinWithMultipleJoinQual1.result        |    2 +
 .../testJoinWithOrPredicates.Hash.plan          |   91 ++
 ...stJoinWithOrPredicates.Hash_NoBroadcast.plan |  117 ++
 .../testJoinWithOrPredicates.Sort.plan          |   91 ++
 ...stJoinWithOrPredicates.Sort_NoBroadcast.plan |  117 ++
 .../testJoinWithOrPredicates.result             |    4 +
 .../testNaturalJoin.Hash.plan                   |   79 ++
 .../testNaturalJoin.Hash_NoBroadcast.plan       |  105 ++
 .../testNaturalJoin.Sort.plan                   |   79 ++
 .../testNaturalJoin.Sort_NoBroadcast.plan       |  105 ++
 .../TestInnerJoinQuery/testNaturalJoin.result   |   27 +
 .../TestInnerJoinQuery/testTPCHQ2Join.Hash.plan |  168 +++
 .../testTPCHQ2Join.Hash_NoBroadcast.plan        |  249 ++++
 .../TestInnerJoinQuery/testTPCHQ2Join.Sort.plan |  168 +++
 .../testTPCHQ2Join.Sort_NoBroadcast.plan        |  249 ++++
 .../TestInnerJoinQuery/testTPCHQ2Join.result    |    5 +
 .../testWhereClauseJoin1.Hash.plan              |   79 ++
 .../testWhereClauseJoin1.Hash_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin1.Sort.plan              |   79 ++
 .../testWhereClauseJoin1.Sort_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin1.result                 |   27 +
 .../testWhereClauseJoin2.Hash.plan              |   79 ++
 .../testWhereClauseJoin2.Hash_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin2.Sort.plan              |   79 ++
 .../testWhereClauseJoin2.Sort_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin2.result                 |   27 +
 .../testWhereClauseJoin3.Hash.plan              |   79 ++
 .../testWhereClauseJoin3.Hash_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin3.Sort.plan              |   79 ++
 .../testWhereClauseJoin3.Sort_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin3.result                 |   27 +
 .../testWhereClauseJoin4.Hash.plan              |   79 ++
 .../testWhereClauseJoin4.Hash_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin4.Sort.plan              |   79 ++
 .../testWhereClauseJoin4.Sort_NoBroadcast.plan  |  105 ++
 .../testWhereClauseJoin4.result                 |   27 +
 .../testWhereClauseJoin5.Hash.plan              |   98 ++
 .../testWhereClauseJoin5.Hash_NoBroadcast.plan  |  153 +++
 .../testWhereClauseJoin5.Sort.plan              |   98 ++
 .../testWhereClauseJoin5.Sort_NoBroadcast.plan  |  153 +++
 .../testWhereClauseJoin5.result                 |    5 +
 .../testWhereClauseJoin6.Hash.plan              |  117 ++
 .../testWhereClauseJoin6.Hash_NoBroadcast.plan  |  201 +++
 .../testWhereClauseJoin6.Sort.plan              |  117 ++
 .../testWhereClauseJoin6.Sort_NoBroadcast.plan  |  201 +++
 .../testWhereClauseJoin6.result                 |    5 +
 .../testBroadcastSubquery.Hash.plan             |  165 +++
 .../testBroadcastSubquery.Hash_NoBroadcast.plan |  165 +++
 .../testBroadcastSubquery.Sort.plan             |  165 +++
 .../testBroadcastSubquery.Sort_NoBroadcast.plan |  165 +++
 .../testBroadcastSubquery.result                |    7 +
 .../testBroadcastSubquery2.Hash.plan            |  276 ++++
 ...testBroadcastSubquery2.Hash_NoBroadcast.plan |  328 +++++
 .../testBroadcastSubquery2.Sort.plan            |  276 ++++
 ...testBroadcastSubquery2.Sort_NoBroadcast.plan |  328 +++++
 .../testBroadcastSubquery2.result               |    3 +
 .../testComplexJoinCondition5.Hash.plan         |  117 ++
 ...tComplexJoinCondition5.Hash_NoBroadcast.plan |  117 ++
 .../testComplexJoinCondition5.Sort.plan         |  117 ++
 ...tComplexJoinCondition5.Sort_NoBroadcast.plan |  117 ++
 .../testComplexJoinCondition5.result            |   29 +
 .../testComplexJoinCondition6.Hash.plan         |  145 ++
 ...tComplexJoinCondition6.Hash_NoBroadcast.plan |  145 ++
 .../testComplexJoinCondition6.Sort.plan         |  145 ++
 ...tComplexJoinCondition6.Sort_NoBroadcast.plan |  145 ++
 .../testComplexJoinCondition6.result            |   56 +
 .../testComplexJoinCondition7.Hash.plan         |  145 ++
 ...tComplexJoinCondition7.Hash_NoBroadcast.plan |  145 ++
 .../testComplexJoinCondition7.Sort.plan         |  145 ++
 ...tComplexJoinCondition7.Sort_NoBroadcast.plan |  145 ++
 .../testComplexJoinCondition7.result            |   56 +
 .../testJoinWithJson2.result                    |    5 +
 .../testJoinWithMultipleJoinQual2.Hash.plan     |  116 ++
 ...nWithMultipleJoinQual2.Hash_NoBroadcast.plan |  142 ++
 .../testJoinWithMultipleJoinQual2.Sort.plan     |  116 ++
 ...nWithMultipleJoinQual2.Sort_NoBroadcast.plan |  142 ++
 .../testJoinWithMultipleJoinQual2.result        |    3 +
 .../testJoinWithMultipleJoinQual3.Hash.plan     |  138 ++
 ...nWithMultipleJoinQual3.Hash_NoBroadcast.plan |  190 +++
 .../testJoinWithMultipleJoinQual3.Sort.plan     |  138 ++
 ...nWithMultipleJoinQual3.Sort_NoBroadcast.plan |  190 +++
 .../testJoinWithMultipleJoinQual3.result        |    5 +
 .../testJoinWithMultipleJoinQual4.Hash.plan     |  142 ++
 ...nWithMultipleJoinQual4.Hash_NoBroadcast.plan |  194 +++
 .../testJoinWithMultipleJoinQual4.Sort.plan     |  142 ++
 ...nWithMultipleJoinQual4.Sort_NoBroadcast.plan |  194 +++
 .../testJoinWithMultipleJoinQual4.result        |    4 +
 .../testBroadcastBasicJoin.result               |   99 --
 ...estBroadcastMultiColumnPartitionTable.result |    5 -
 ...castMultiColumnPartitionTableInFilter.result |    0
 .../testBroadcastPartitionTable.result          |    5 -
 .../testBroadcastSubquery.result                |   15 -
 .../testBroadcastSubquery2.result               |    3 -
 .../testBroadcastTwoPartJoin.result             |   15 -
 .../TestJoinBroadcast/testCrossJoin.result      |  127 --
 .../testCrossJoinAndCaseWhen.result             |   27 -
 .../testCrossJoinWithAsterisk1.result           |   27 -
 .../testCrossJoinWithAsterisk2.result           |   27 -
 .../testCrossJoinWithAsterisk3.result           |   27 -
 .../testCrossJoinWithAsterisk4.result           |   27 -
 .../testCrossJoinWithEmptyTable1.result         |    2 -
 .../TestJoinBroadcast/testFullOuterJoin1.result |    7 -
 .../testFullOuterJoinWithEmptyTable1.result     |    7 -
 .../testInnerJoinWithEmptyTable.result          |    2 -
 .../testJoinCoReferredEvals1.result             |   27 -
 ...testJoinCoReferredEvalsWithSameExprs1.result |   22 -
 ...testJoinCoReferredEvalsWithSameExprs2.result |   22 -
 .../testJoinOnMultipleDatabases.result          |    5 -
 .../TestJoinBroadcast/testLeftOuterJoin1.result |    7 -
 .../TestJoinBroadcast/testLeftOuterJoin2.result |   99 --
 .../TestJoinBroadcast/testLeftOuterJoin3.result |  174 ---
 .../testLeftOuterJoinWithConstantExpr1.result   |    7 -
 .../testLeftOuterJoinWithConstantExpr2.result   |    7 -
 .../testLeftOuterJoinWithConstantExpr3.result   |    7 -
 .../testLeftOuterJoinWithEmptyTable1.result     |    7 -
 .../testLeftOuterJoinWithEmptyTable2.result     |    7 -
 .../testLeftOuterJoinWithEmptyTable3.result     |    7 -
 .../testLeftOuterJoinWithEmptyTable4.result     |    4 -
 ...ltipleBroadcastDataFileWithZeroLength.result |    2 -
 ...tipleBroadcastDataFileWithZeroLength2.result |  399 ------
 ...tionedBroadcastDataFileWithZeroLength.result |  102 --
 ...ionedBroadcastDataFileWithZeroLength2.result |  399 ------
 .../testOuterJoinAndCaseWhen1.result            |    7 -
 .../testRightOuterJoin1.result                  |    7 -
 .../testRightOuterJoinWithEmptyTable1.result    |    7 -
 .../TestJoinBroadcast/testTPCHQ2Join.result     |    5 -
 .../testWhereClauseJoin1.result                 |   27 -
 .../testWhereClauseJoin2.result                 |   27 -
 .../testWhereClauseJoin3.result                 |   27 -
 .../testWhereClauseJoin4.result                 |   27 -
 .../testWhereClauseJoin5.result                 |    5 -
 .../selfJoinOfPartitionedTable.result           |    2 +-
 .../testBroadcastPartitionTable.result          |    5 +
 ...FilterPushDownPartitionColumnCaseWhen.result |    2 +-
 ...tionedBroadcastDataFileWithZeroLength.result |    7 +
 ...ionedBroadcastDataFileWithZeroLength2.result |    7 +
 .../testNoProjectionJoinQual.result             |    2 +-
 .../testPartialFilterPushDown.result            |    2 +-
 .../testPartialFilterPushDownOuterJoin.result   |    2 +-
 .../testPartialFilterPushDownOuterJoin2.result  |    2 +-
 ...estPartitionMultiplePartitionFilter.1.result |    2 +
 .../testPartitionTableJoinSmallTable.result     |    2 +-
 .../testComplexJoinCondition1.result            |   27 -
 .../testComplexJoinCondition2.result            |   27 -
 .../testComplexJoinCondition3.result            |   27 -
 .../testComplexJoinCondition4.result            |   29 -
 .../testComplexJoinCondition5.result            |   29 -
 .../testComplexJoinCondition6.result            |   56 -
 .../testComplexJoinCondition7.result            |   56 -
 .../testComplexJoinsWithCaseWhen.result         |   27 -
 .../testComplexJoinsWithCaseWhen2.result        |   27 -
 .../results/TestJoinQuery/testCrossJoin.result  |  127 --
 .../testCrossJoinWithAsterisk1.result           |   27 -
 .../testCrossJoinWithAsterisk2.result           |   27 -
 .../testCrossJoinWithAsterisk3.result           |   27 -
 .../testCrossJoinWithAsterisk4.result           |   27 -
 .../testCrossJoinWithEmptyTable1.result         |    2 -
 ...rossJoinWithThetaJoinConditionInWhere.result |   12 -
 .../testDifferentTypesJoinCondition.result      |    7 -
 .../TestJoinQuery/testFullOuterJoin1.result     |    7 -
 .../testFullOuterJoinWithEmptyTable1.result     |    7 -
 .../testInnerJoinAndCaseWhen.result             |   27 -
 .../testInnerJoinWithEmptyTable.result          |    2 -
 ...nnerJoinWithThetaJoinConditionInWhere.result |    7 -
 .../TestJoinQuery/testJoinAsterisk.result       |    7 -
 .../testJoinCoReferredEvals1.result             |   27 -
 ...testJoinCoReferredEvalsWithSameExprs1.result |   22 -
 ...testJoinCoReferredEvalsWithSameExprs2.result |   22 -
 .../testJoinFilterOfRowPreservedTable1.result   |   15 -
 .../testJoinOnMultipleDatabases.result          |    5 -
 .../testJoinOnMultipleDatabasesWithJson.result  |    5 -
 .../TestJoinQuery/testJoinWithJson.result       |   27 -
 .../TestJoinQuery/testJoinWithJson2.result      |    5 -
 .../testJoinWithMultipleJoinQual1.result        |    2 -
 .../testJoinWithMultipleJoinQual2.result        |    3 -
 .../testJoinWithMultipleJoinQual3.result        |    5 -
 .../testJoinWithMultipleJoinQual4.result        |    4 -
 .../testJoinWithMultipleJoinTypes.result        |    6 -
 .../testJoinWithOrPredicates.result             |    4 -
 .../TestJoinQuery/testLeftOuterJoin1.result     |    7 -
 .../testLeftOuterJoinWithConstantExpr1.result   |    7 -
 .../testLeftOuterJoinWithConstantExpr2.result   |    7 -
 .../testLeftOuterJoinWithConstantExpr3.result   |    7 -
 .../testLeftOuterJoinWithConstantExpr4.result   |    7 -
 .../testLeftOuterJoinWithConstantExpr5.result   |    6 -
 .../testLeftOuterJoinWithEmptyTable1.result     |    7 -
 .../testLeftOuterJoinWithEmptyTable2.result     |    7 -
 .../testLeftOuterJoinWithEmptyTable3.result     |    7 -
 .../testLeftOuterJoinWithEmptyTable4.result     |    4 -
 .../testLeftOuterJoinWithEmptyTable5.result     |    4 -
 .../testLeftOuterJoinWithNull1.result           |    4 -
 .../testLeftOuterJoinWithNull2.result           |    4 -
 .../testLeftOuterJoinWithNull3.result           |    2 -
 ...uterJoinWithThetaJoinConditionInWhere.result |    4 -
 .../TestJoinQuery/testNaturalJoin.result        |   27 -
 .../testOuterJoinAndCaseWhen1.result            |    7 -
 .../TestJoinQuery/testRightOuterJoin1.result    |    7 -
 .../testRightOuterJoinWithEmptyTable1.result    |    7 -
 ...uterJoinWithThetaJoinConditionInWhere.result |    4 -
 .../results/TestJoinQuery/testTPCHQ2Join.result |    5 -
 .../TestJoinQuery/testWhereClauseJoin1.result   |   27 -
 .../TestJoinQuery/testWhereClauseJoin2.result   |   27 -
 .../TestJoinQuery/testWhereClauseJoin3.result   |   27 -
 .../TestJoinQuery/testWhereClauseJoin4.result   |   27 -
 .../TestJoinQuery/testWhereClauseJoin5.result   |    5 -
 .../testComplexJoinsWithCaseWhen.Hash.plan      |   98 ++
 ...mplexJoinsWithCaseWhen.Hash_NoBroadcast.plan |  153 +++
 .../testComplexJoinsWithCaseWhen.Sort.plan      |   98 ++
 ...mplexJoinsWithCaseWhen.Sort_NoBroadcast.plan |  153 +++
 .../testComplexJoinsWithCaseWhen.result         |   27 +
 .../testComplexJoinsWithCaseWhen2.Hash.plan     |  138 ++
 ...plexJoinsWithCaseWhen2.Hash_NoBroadcast.plan |  165 +++
 .../testComplexJoinsWithCaseWhen2.Sort.plan     |  138 ++
 ...plexJoinsWithCaseWhen2.Sort_NoBroadcast.plan |  165 +++
 .../testComplexJoinsWithCaseWhen2.result        |   27 +
 .../testInnerAndOuterWithEmpty.1.Hash.plan      |   75 ++
 ...nerAndOuterWithEmpty.1.Hash_NoBroadcast.plan |  130 ++
 .../testInnerAndOuterWithEmpty.1.Sort.plan      |   75 ++
 ...nerAndOuterWithEmpty.1.Sort_NoBroadcast.plan |  130 ++
 .../testInnerAndOuterWithEmpty.1.result         |    7 +
 .../testJoinWithMultipleJoinTypes.Hash.plan     |  140 ++
 ...nWithMultipleJoinTypes.Hash_NoBroadcast.plan |  140 ++
 .../testJoinWithMultipleJoinTypes.Sort.plan     |  140 ++
 ...nWithMultipleJoinTypes.Sort_NoBroadcast.plan |  140 ++
 .../testJoinWithMultipleJoinTypes.result        |    6 +
 .../testFullOuterJoin1.Hash.plan                |   79 ++
 .../testFullOuterJoin1.Hash_NoBroadcast.plan    |  105 ++
 .../testFullOuterJoin1.Sort.plan                |   79 ++
 .../testFullOuterJoin1.Sort_NoBroadcast.plan    |  105 ++
 .../testFullOuterJoin1.result                   |    7 +
 .../testFullOuterJoinWithEmptyTable1.Hash.plan  |   79 ++
 ...terJoinWithEmptyTable1.Hash_NoBroadcast.plan |  105 ++
 .../testFullOuterJoinWithEmptyTable1.Sort.plan  |   79 ++
 ...terJoinWithEmptyTable1.Sort_NoBroadcast.plan |  105 ++
 .../testFullOuterJoinWithEmptyTable1.result     |    7 +
 ...testJoinFilterOfRowPreservedTable1.Hash.plan |   78 ++
 ...erOfRowPreservedTable1.Hash_NoBroadcast.plan |  105 ++
 ...testJoinFilterOfRowPreservedTable1.Sort.plan |   78 ++
 ...erOfRowPreservedTable1.Sort_NoBroadcast.plan |  105 ++
 .../testJoinFilterOfRowPreservedTable1.result   |   15 +
 .../testLeftOuterJoin1.Hash.plan                |   78 ++
 .../testLeftOuterJoin1.Hash_NoBroadcast.plan    |  105 ++
 .../testLeftOuterJoin1.Sort.plan                |   78 ++
 .../testLeftOuterJoin1.Sort_NoBroadcast.plan    |  105 ++
 .../testLeftOuterJoin1.result                   |    7 +
 .../testLeftOuterJoin2.Hash.plan                |   91 ++
 .../testLeftOuterJoin2.Hash_NoBroadcast.plan    |  176 +++
 .../testLeftOuterJoin2.Sort.plan                |   91 ++
 .../testLeftOuterJoin2.Sort_NoBroadcast.plan    |  176 +++
 .../testLeftOuterJoin2.result                   |    7 +
 .../testLeftOuterJoin3.Hash.plan                |  129 ++
 .../testLeftOuterJoin3.Hash_NoBroadcast.plan    |  272 ++++
 .../testLeftOuterJoin3.Sort.plan                |  129 ++
 .../testLeftOuterJoin3.Sort_NoBroadcast.plan    |  272 ++++
 .../testLeftOuterJoin3.result                   |    9 +
 ...tLeftOuterJoinLeftSideSmallTable.1.Hash.plan |  105 ++
 ...inLeftSideSmallTable.1.Hash_NoBroadcast.plan |  105 ++
 ...tLeftOuterJoinLeftSideSmallTable.1.Sort.plan |  105 ++
 ...inLeftSideSmallTable.1.Sort_NoBroadcast.plan |  105 ++
 ...testLeftOuterJoinLeftSideSmallTable.1.result |    7 +
 ...tOuterJoinPredicationCaseByCase1.1.Hash.plan |   72 +
 ...edicationCaseByCase1.1.Hash_NoBroadcast.plan |  128 ++
 ...tOuterJoinPredicationCaseByCase1.1.Sort.plan |   72 +
 ...edicationCaseByCase1.1.Sort_NoBroadcast.plan |  128 ++
 ...LeftOuterJoinPredicationCaseByCase1.1.result |    7 +
 ...tOuterJoinPredicationCaseByCase2.1.Hash.plan |   91 ++
 ...edicationCaseByCase2.1.Hash_NoBroadcast.plan |  176 +++
 ...tOuterJoinPredicationCaseByCase2.1.Sort.plan |   91 ++
 ...edicationCaseByCase2.1.Sort_NoBroadcast.plan |  176 +++
 ...LeftOuterJoinPredicationCaseByCase2.1.result |    4 +
 ...uterJoinPredicationCaseByCase2_1.1.Hash.plan |   98 ++
 ...icationCaseByCase2_1.1.Hash_NoBroadcast.plan |  182 +++
 ...uterJoinPredicationCaseByCase2_1.1.Sort.plan |   98 ++
 ...icationCaseByCase2_1.1.Sort_NoBroadcast.plan |  182 +++
 ...ftOuterJoinPredicationCaseByCase2_1.1.result |    5 +
 ...tOuterJoinPredicationCaseByCase3.1.Hash.plan |   72 +
 ...edicationCaseByCase3.1.Hash_NoBroadcast.plan |  128 ++
 ...tOuterJoinPredicationCaseByCase3.1.Sort.plan |   72 +
 ...edicationCaseByCase3.1.Sort_NoBroadcast.plan |  128 ++
 ...LeftOuterJoinPredicationCaseByCase3.1.result |    7 +
 ...tOuterJoinPredicationCaseByCase4.1.Hash.plan |   74 ++
 ...edicationCaseByCase4.1.Hash_NoBroadcast.plan |  130 ++
 ...tOuterJoinPredicationCaseByCase4.1.Sort.plan |   74 ++
 ...edicationCaseByCase4.1.Sort_NoBroadcast.plan |  130 ++
 ...LeftOuterJoinPredicationCaseByCase4.1.result |    7 +
 ...tOuterJoinPredicationCaseByCase5.1.Hash.plan |   74 ++
 ...edicationCaseByCase5.1.Hash_NoBroadcast.plan |  130 ++
 ...tOuterJoinPredicationCaseByCase5.1.Sort.plan |   74 ++
 ...edicationCaseByCase5.1.Sort_NoBroadcast.plan |  130 ++
 ...LeftOuterJoinPredicationCaseByCase5.1.result |    6 +
 ...tOuterJoinPredicationCaseByCase6.1.Hash.plan |   76 ++
 ...edicationCaseByCase6.1.Hash_NoBroadcast.plan |  132 ++
 ...tOuterJoinPredicationCaseByCase6.1.Sort.plan |   76 ++
 ...edicationCaseByCase6.1.Sort_NoBroadcast.plan |  132 ++
 ...LeftOuterJoinPredicationCaseByCase6.1.result |    3 +
 ...testLeftOuterJoinWithConstantExpr1.Hash.plan |   86 ++
 ...rJoinWithConstantExpr1.Hash_NoBroadcast.plan |  113 ++
 ...testLeftOuterJoinWithConstantExpr1.Sort.plan |   86 ++
 ...rJoinWithConstantExpr1.Sort_NoBroadcast.plan |  113 ++
 .../testLeftOuterJoinWithConstantExpr1.result   |    7 +
 ...testLeftOuterJoinWithConstantExpr4.Hash.plan |   63 +
 ...rJoinWithConstantExpr4.Hash_NoBroadcast.plan |   90 ++
 ...testLeftOuterJoinWithConstantExpr4.Sort.plan |   63 +
 ...rJoinWithConstantExpr4.Sort_NoBroadcast.plan |   90 ++
 .../testLeftOuterJoinWithConstantExpr4.result   |    7 +
 ...testLeftOuterJoinWithConstantExpr5.Hash.plan |   65 +
 ...rJoinWithConstantExpr5.Hash_NoBroadcast.plan |   92 ++
 ...testLeftOuterJoinWithConstantExpr5.Sort.plan |   65 +
 ...rJoinWithConstantExpr5.Sort_NoBroadcast.plan |   92 ++
 .../testLeftOuterJoinWithConstantExpr5.result   |    6 +
 .../testLeftOuterJoinWithEmptyTable1.Hash.plan  |   78 ++
 ...terJoinWithEmptyTable1.Hash_NoBroadcast.plan |  105 ++
 .../testLeftOuterJoinWithEmptyTable1.Sort.plan  |   78 ++
 ...terJoinWithEmptyTable1.Sort_NoBroadcast.plan |  105 ++
 .../testLeftOuterJoinWithEmptyTable1.result     |    7 +
 .../testLeftOuterJoinWithEmptyTable2.Hash.plan  |  109 ++
 ...terJoinWithEmptyTable2.Hash_NoBroadcast.plan |  136 ++
 .../testLeftOuterJoinWithEmptyTable2.Sort.plan  |  109 ++
 ...terJoinWithEmptyTable2.Sort_NoBroadcast.plan |  136 ++
 .../testLeftOuterJoinWithEmptyTable2.result     |    7 +
 .../testLeftOuterJoinWithEmptyTable3.Hash.plan  |  160 +++
 ...terJoinWithEmptyTable3.Hash_NoBroadcast.plan |  187 +++
 .../testLeftOuterJoinWithEmptyTable3.Sort.plan  |  160 +++
 ...terJoinWithEmptyTable3.Sort_NoBroadcast.plan |  187 +++
 .../testLeftOuterJoinWithEmptyTable3.result     |    7 +
 .../testLeftOuterJoinWithEmptyTable4.Hash.plan  |  160 +++
 ...terJoinWithEmptyTable4.Hash_NoBroadcast.plan |  214 +++
 .../testLeftOuterJoinWithEmptyTable4.Sort.plan  |  160 +++
 ...terJoinWithEmptyTable4.Sort_NoBroadcast.plan |  214 +++
 .../testLeftOuterJoinWithEmptyTable4.result     |    4 +
 .../testLeftOuterJoinWithEmptyTable5.Hash.plan  |  109 ++
 ...terJoinWithEmptyTable5.Hash_NoBroadcast.plan |  136 ++
 .../testLeftOuterJoinWithEmptyTable5.Sort.plan  |  109 ++
 ...terJoinWithEmptyTable5.Sort_NoBroadcast.plan |  136 ++
 .../testLeftOuterJoinWithEmptyTable5.result     |    4 +
 .../testLeftOuterJoinWithNull1.Hash.plan        |   82 ++
 ...LeftOuterJoinWithNull1.Hash_NoBroadcast.plan |  109 ++
 .../testLeftOuterJoinWithNull1.Sort.plan        |   82 ++
 ...LeftOuterJoinWithNull1.Sort_NoBroadcast.plan |  109 ++
 .../testLeftOuterJoinWithNull1.result           |    4 +
 .../testLeftOuterJoinWithNull2.Hash.plan        |   82 ++
 ...LeftOuterJoinWithNull2.Hash_NoBroadcast.plan |  109 ++
 .../testLeftOuterJoinWithNull2.Sort.plan        |   82 ++
 ...LeftOuterJoinWithNull2.Sort_NoBroadcast.plan |  109 ++
 .../testLeftOuterJoinWithNull2.result           |    4 +
 .../testLeftOuterJoinWithNull3.Hash.plan        |   82 ++
 ...LeftOuterJoinWithNull3.Hash_NoBroadcast.plan |  109 ++
 .../testLeftOuterJoinWithNull3.Sort.plan        |   82 ++
 ...LeftOuterJoinWithNull3.Sort_NoBroadcast.plan |  109 ++
 .../testLeftOuterJoinWithNull3.result           |    2 +
 ...rJoinWithThetaJoinConditionInWhere.Hash.plan |   57 +
 ...taJoinConditionInWhere.Hash_NoBroadcast.plan |   84 ++
 ...rJoinWithThetaJoinConditionInWhere.Sort.plan |   57 +
 ...taJoinConditionInWhere.Sort_NoBroadcast.plan |   84 ++
 ...uterJoinWithThetaJoinConditionInWhere.result |    4 +
 .../testLeftOuterWithEmptyTable.1.Hash.plan     |   53 +
 ...tOuterWithEmptyTable.1.Hash_NoBroadcast.plan |   80 ++
 .../testLeftOuterWithEmptyTable.1.Sort.plan     |   53 +
 ...tOuterWithEmptyTable.1.Sort_NoBroadcast.plan |   80 ++
 .../testLeftOuterWithEmptyTable.1.result        |    7 +
 ...pleBroadcastDataFileWithZeroLength.Hash.plan |   57 +
 ...DataFileWithZeroLength.Hash_NoBroadcast.plan |   84 ++
 ...pleBroadcastDataFileWithZeroLength.Sort.plan |   57 +
 ...DataFileWithZeroLength.Sort_NoBroadcast.plan |   84 ++
 ...ltipleBroadcastDataFileWithZeroLength.result |    2 +
 ...leBroadcastDataFileWithZeroLength2.Hash.plan |   76 ++
 ...ataFileWithZeroLength2.Hash_NoBroadcast.plan |  132 ++
 ...leBroadcastDataFileWithZeroLength2.Sort.plan |   76 ++
 ...ataFileWithZeroLength2.Sort_NoBroadcast.plan |  132 ++
 ...tipleBroadcastDataFileWithZeroLength2.result |    7 +
 .../testOuterJoinAndCaseWhen1.Hash.plan         |   97 ++
 ...tOuterJoinAndCaseWhen1.Hash_NoBroadcast.plan |  153 +++
 .../testOuterJoinAndCaseWhen1.Sort.plan         |   97 ++
 ...tOuterJoinAndCaseWhen1.Sort_NoBroadcast.plan |  153 +++
 .../testOuterJoinAndCaseWhen1.result            |    7 +
 .../testRightOuterJoin1.Hash.plan               |   78 ++
 .../testRightOuterJoin1.Hash_NoBroadcast.plan   |  105 ++
 .../testRightOuterJoin1.Sort.plan               |   78 ++
 .../testRightOuterJoin1.Sort_NoBroadcast.plan   |  105 ++
 .../testRightOuterJoin1.result                  |    7 +
 .../testRightOuterJoinWithEmptyTable1.Hash.plan |   78 ++
 ...terJoinWithEmptyTable1.Hash_NoBroadcast.plan |  105 ++
 .../testRightOuterJoinWithEmptyTable1.Sort.plan |   78 ++
 ...terJoinWithEmptyTable1.Sort_NoBroadcast.plan |  105 ++
 .../testRightOuterJoinWithEmptyTable1.result    |    7 +
 ...rJoinWithThetaJoinConditionInWhere.Hash.plan |   57 +
 ...taJoinConditionInWhere.Hash_NoBroadcast.plan |   84 ++
 ...rJoinWithThetaJoinConditionInWhere.Sort.plan |   57 +
 ...taJoinConditionInWhere.Sort_NoBroadcast.plan |   84 ++
 ...uterJoinWithThetaJoinConditionInWhere.result |    4 +
 ...terJoinWithEmptyIntermediateData.1.Hash.plan |  108 ++
 ...mptyIntermediateData.1.Hash_NoBroadcast.plan |  108 ++
 ...terJoinWithEmptyIntermediateData.1.Sort.plan |  108 ++
 ...mptyIntermediateData.1.Sort_NoBroadcast.plan |  108 ++
 ...lOuterJoinWithEmptyIntermediateData.1.result |    2 +
 .../testJoinWithDifferentShuffleKey.1.Hash.plan |  199 +++
 ...hDifferentShuffleKey.1.Hash_NoBroadcast.plan |  199 +++
 .../testJoinWithDifferentShuffleKey.1.Sort.plan |  199 +++
 ...hDifferentShuffleKey.1.Sort_NoBroadcast.plan |  199 +++
 .../testJoinWithDifferentShuffleKey.1.result    |    3 +
 ...testLeftOuterJoinWithConstantExpr2.Hash.plan |  125 ++
 ...rJoinWithConstantExpr2.Hash_NoBroadcast.plan |  125 ++
 ...testLeftOuterJoinWithConstantExpr2.Sort.plan |  125 ++
 ...rJoinWithConstantExpr2.Sort_NoBroadcast.plan |  125 ++
 .../testLeftOuterJoinWithConstantExpr2.result   |    7 +
 ...testLeftOuterJoinWithConstantExpr3.Hash.plan |  156 +++
 ...rJoinWithConstantExpr3.Hash_NoBroadcast.plan |  156 +++
 ...testLeftOuterJoinWithConstantExpr3.Sort.plan |  156 +++
 ...rJoinWithConstantExpr3.Sort_NoBroadcast.plan |  156 +++
 .../testLeftOuterJoinWithConstantExpr3.result   |    7 +
 ...tLeftOuterJoinWithEmptySubquery1.1.Hash.plan |  141 ++
 ...inWithEmptySubquery1.1.Hash_NoBroadcast.plan |  167 +++
 ...tLeftOuterJoinWithEmptySubquery1.1.Sort.plan |  141 ++
 ...inWithEmptySubquery1.1.Sort_NoBroadcast.plan |  167 +++
 ...testLeftOuterJoinWithEmptySubquery1.1.result |    7 +
 ...tLeftOuterJoinWithEmptySubquery2.1.Hash.plan |  116 ++
 ...inWithEmptySubquery2.1.Hash_NoBroadcast.plan |  142 ++
 ...tLeftOuterJoinWithEmptySubquery2.1.Sort.plan |  116 ++
 ...inWithEmptySubquery2.1.Sort_NoBroadcast.plan |  142 ++
 ...testLeftOuterJoinWithEmptySubquery2.1.result |    2 +
 .../testExplainSelectPhysical.1.result          |    4 +-
 .../testExplainSelectPhysical.2.result          |   42 +-
 .../testExplainSelectPhysical.3.result          |    4 +-
 .../testSelectOnSessionTable.result             |    3 +
 tajo-dist/src/main/bin/tajo                     |    4 +
 .../plan/exprrewrite/rules/ConstantFolding.java |   10 +-
 .../org/apache/tajo/storage/MergeScanner.java   |    2 +-
 .../org/apache/tajo/storage/StorageManager.java |  389 ------
 .../org/apache/tajo/storage/TableSpace.java     |   77 --
 .../apache/tajo/storage/TableSpaceManager.java  |   30 +-
 .../org/apache/tajo/storage/Tablespace.java     |  375 ++++++
 .../src/main/resources/storage-default.xml      |    4 +-
 .../src/test/resources/storage-default.xml      |    4 +-
 .../tajo/storage/hbase/HBasePutAppender.java    |    4 +-
 .../apache/tajo/storage/hbase/HBaseScanner.java |    4 +-
 .../tajo/storage/hbase/HBaseStorageManager.java | 1148 ----------------
 .../tajo/storage/hbase/HBaseTablespace.java     | 1147 ++++++++++++++++
 .../storage/hbase/TestHBaseStorageManager.java  |    4 +-
 .../org/apache/tajo/storage/FileAppender.java   |    2 +-
 .../apache/tajo/storage/FileStorageManager.java | 1251 ------------------
 .../org/apache/tajo/storage/FileTablespace.java | 1227 +++++++++++++++++
 .../storage/HashShuffleAppenderManager.java     |    2 +-
 .../tajo/storage/TestCompressionStorages.java   |    2 +-
 .../tajo/storage/TestFileStorageManager.java    |   10 +-
 .../apache/tajo/storage/TestFileSystems.java    |    4 +-
 .../apache/tajo/storage/TestMergeScanner.java   |    2 +-
 .../org/apache/tajo/storage/TestStorages.java   |   28 +-
 .../apache/tajo/storage/index/TestBSTIndex.java |   20 +-
 .../index/TestSingleCSVFileBSTIndex.java        |    4 +-
 .../src/test/resources/storage-default.xml      |    4 +-
 744 files changed, 46771 insertions(+), 10306 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/CHANGES
----------------------------------------------------------------------
diff --cc CHANGES
index b2b457c,f1b7e6e..bad7753
--- a/CHANGES
+++ b/CHANGES
@@@ -128,10 -136,12 +136,16 @@@ Release 0.11.0 - unrelease
  
    BUG FIXES
  
 +    TAJO-1608: Fix test failure in index_support branch. (jihoon)
 +
 +    TAJO-1594: Catalog schema is invalid for some databases. (jihoon)
 +
+     TAJO-1620: random() in an SQL should generate RANDOM numbers.
+     (Contributed by Jongyoung Park, Committed by jihoon)
+ 
+     TAJO-1558: HBASE_LIB/hbase-server-*.jar should be included in the CLASSPATH.
+     (Contributed by Jongyoung Park, Committed by jaehwa)
+ 
      TAJO-1605: Fix master build failure on jdk 1.6. (jinho)
  
      TAJO-1485: Datum 'Char' returned only 1byte.

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java
----------------------------------------------------------------------
diff --cc tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java
index 2f46026,0252051..3d09eb1
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java
@@@ -46,12 -47,8 +46,12 @@@ import org.apache.tajo.ipc.TajoWorkerPr
  import org.apache.tajo.ipc.TajoWorkerProtocol.DistinctGroupbyEnforcer.SortSpecArray;
  import org.apache.tajo.plan.LogicalPlan;
  import org.apache.tajo.plan.logical.*;
 +import org.apache.tajo.plan.serder.LogicalNodeDeserializer;
  import org.apache.tajo.plan.util.PlannerUtil;
- import org.apache.tajo.storage.FileStorageManager;
 -import org.apache.tajo.storage.*;
++import org.apache.tajo.storage.FileTablespace;
 +import org.apache.tajo.storage.StorageConstants;
- import org.apache.tajo.storage.StorageManager;
 +import org.apache.tajo.storage.TableSpaceManager;
++import org.apache.tajo.storage.Tablespace;
  import org.apache.tajo.storage.fragment.FileFragment;
  import org.apache.tajo.storage.fragment.Fragment;
  import org.apache.tajo.storage.fragment.FragmentConvertor;

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java
----------------------------------------------------------------------
diff --cc tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java
index fc9212c,2cd585f..422d034
--- a/tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/GlobalEngine.java
@@@ -53,10 -53,9 +53,10 @@@ import org.apache.tajo.plan.verifier.Lo
  import org.apache.tajo.plan.verifier.PreLogicalPlanVerifier;
  import org.apache.tajo.plan.verifier.VerificationState;
  import org.apache.tajo.plan.verifier.VerifyException;
- import org.apache.tajo.storage.StorageManager;
+ import org.apache.tajo.storage.Tablespace;
  import org.apache.tajo.storage.TableSpaceManager;
  import org.apache.tajo.util.CommonTestingUtil;
 +import org.apache.tajo.util.IPCUtil;
  
  import java.io.IOException;
  import java.sql.SQLException;

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/master/exec/NonForwardQueryResultSystemScanner.java
----------------------------------------------------------------------
diff --cc tajo-core/src/main/java/org/apache/tajo/master/exec/NonForwardQueryResultSystemScanner.java
index 1150007,6c1399e..3370893
--- a/tajo-core/src/main/java/org/apache/tajo/master/exec/NonForwardQueryResultSystemScanner.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/exec/NonForwardQueryResultSystemScanner.java
@@@ -22,13 -23,10 +23,14 @@@ import com.google.protobuf.ByteString
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.tajo.QueryId;
+ import org.apache.tajo.SessionVars;
  import org.apache.tajo.TaskAttemptId;
  import org.apache.tajo.TaskId;
 -import org.apache.tajo.catalog.*;
 +import org.apache.tajo.catalog.CatalogUtil;
 +import org.apache.tajo.catalog.Column;
 +import org.apache.tajo.catalog.Schema;
 +import org.apache.tajo.catalog.TableDesc;
 +import org.apache.tajo.catalog.TableMeta;
  import org.apache.tajo.catalog.proto.CatalogProtos.*;
  import org.apache.tajo.catalog.statistics.TableStats;
  import org.apache.tajo.common.TajoDataTypes.DataType;

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/master/exec/QueryExecutor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
----------------------------------------------------------------------
diff --cc tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
index 640ec60,a48f0a0..8441922
--- a/tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
+++ b/tajo-core/src/main/java/org/apache/tajo/querymaster/QueryMasterTask.java
@@@ -50,12 -44,18 +50,12 @@@ import org.apache.tajo.ipc.TajoWorkerPr
  import org.apache.tajo.master.TajoContainerProxy;
  import org.apache.tajo.master.event.*;
  import org.apache.tajo.master.rm.TajoWorkerResourceManager;
 -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.logical.LogicalRootNode;
  import org.apache.tajo.plan.logical.NodeType;
  import org.apache.tajo.plan.logical.ScanNode;
 -import org.apache.tajo.plan.rewrite.LogicalPlanRewriteRule;
 -import org.apache.tajo.plan.util.PlannerUtil;
  import org.apache.tajo.plan.verifier.VerifyException;
  import org.apache.tajo.session.Session;
- import org.apache.tajo.storage.StorageManager;
+ import org.apache.tajo.storage.Tablespace;
  import org.apache.tajo.storage.StorageProperty;
  import org.apache.tajo.storage.StorageUtil;
  import org.apache.tajo.storage.TableSpaceManager;

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/main/java/org/apache/tajo/worker/Task.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashAntiJoinExec.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestHashSemiJoinExec.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
----------------------------------------------------------------------
diff --cc tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
index 0b12be1,7f92667..82c91a1
--- 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
@@@ -971,19 -970,14 +971,19 @@@ public class TestPhysicalPlanner 
    }
  
    public final String [] createIndexStmt = {
 -      "create index idx_employee on employee using bst (name null first, empId desc)"
 +      "create index idx_employee on employee using TWO_LEVEL_BIN_TREE (name null first, empId desc)"
    };
  
 -  //@Test
 +  @Test
    public final void testCreateIndex() throws IOException, PlanningException {
-     FileFragment[] frags = FileStorageManager.splitNG(conf, "default.employee", employee.getMeta(),
+     FileFragment[] frags = FileTablespace.splitNG(conf, "default.employee", employee.getMeta(),
          new Path(employee.getPath()), Integer.MAX_VALUE);
      Path workDir = CommonTestingUtil.getTestDir(TajoTestingCluster.DEFAULT_TEST_DIRECTORY + "/testCreateIndex");
 +    Path indexPath = StorageUtil.concatPath(TajoConf.getWarehouseDir(conf), "default/idx_employee");
 +    if (sm.getFileSystem().exists(indexPath)) {
 +      sm.getFileSystem().delete(indexPath, true);
 +    }
 +
      TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf),
          LocalTajoTestingUtility.newTaskAttemptId(masterPlan),
          new FileFragment[] {frags[0]}, workDir);

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
----------------------------------------------------------------------
diff --cc tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestSortExec.java
index a893798,6e0aa8e..eb2c03d
--- 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
@@@ -112,9 -110,9 +112,9 @@@ public class TestSortExec 
  
    @Test
    public final void testNext() throws IOException, PlanningException {
-     FileFragment[] frags = FileStorageManager.splitNG(conf, "default.employee", employeeMeta, tablePath, Integer.MAX_VALUE);
+     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),
 +    TaskAttemptContext ctx = new TaskAttemptContext(queryContext,
          LocalTajoTestingUtility
          .newTaskAttemptId(), new FileFragment[] { frags[0] }, workDir);
      ctx.setEnforcer(new Enforcer());

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-core/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
----------------------------------------------------------------------
diff --cc tajo-core/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
index 35cd612,0a473b5..948ba4e
--- a/tajo-core/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
+++ b/tajo-core/src/test/java/org/apache/tajo/master/TestExecutionBlockCursor.java
@@@ -80,9 -80,9 +80,9 @@@ public class TestExecutionBlockCursor 
  
      analyzer = new SQLAnalyzer();
      logicalPlanner = new LogicalPlanner(catalog);
 -    optimizer = new LogicalOptimizer(conf);
 +    optimizer = new LogicalOptimizer(conf, catalog);
  
-     StorageManager sm  = TableSpaceManager.getFileStorageManager(conf);
+     Tablespace sm  = TableSpaceManager.getFileStorageManager(conf);
      dispatcher = new AsyncDispatcher();
      dispatcher.init(conf);
      dispatcher.start();

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/TableSpaceManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/Tablespace.java
----------------------------------------------------------------------
diff --cc tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/Tablespace.java
index 0000000,0626da8..c89f043
mode 000000,100644..100644
--- a/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/Tablespace.java
+++ b/tajo-storage/tajo-storage-common/src/main/java/org/apache/tajo/storage/Tablespace.java
@@@ -1,0 -1,360 +1,375 @@@
+ /**
+  * Licensed to the Apache Software Foundation (ASF) under one
+  * or more contributor license agreements.  See the NOTICE file
+  * distributed with this work for additional information
+  * regarding copyright ownership.  The ASF licenses this file
+  * to you under the Apache License, Version 2.0 (the
+  * "License"); you may not use this file except in compliance
+  * with the License.  You may obtain a copy of the License at
+  *
+  *     http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ 
+ package org.apache.tajo.storage;
+ 
+ import org.apache.hadoop.fs.Path;
+ import org.apache.hadoop.fs.PathFilter;
+ import org.apache.tajo.ExecutionBlockId;
+ import org.apache.tajo.OverridableConf;
+ import org.apache.tajo.TajoConstants;
+ import org.apache.tajo.TaskAttemptId;
+ import org.apache.tajo.catalog.Schema;
+ import org.apache.tajo.catalog.SortSpec;
+ import org.apache.tajo.catalog.TableDesc;
+ import org.apache.tajo.catalog.TableMeta;
+ import org.apache.tajo.catalog.proto.CatalogProtos.FragmentProto;
+ import org.apache.tajo.conf.TajoConf;
+ import org.apache.tajo.conf.TajoConf.ConfVars;
+ import org.apache.tajo.plan.LogicalPlan;
+ import org.apache.tajo.plan.logical.LogicalNode;
+ import org.apache.tajo.plan.logical.ScanNode;
+ import org.apache.tajo.plan.rewrite.LogicalPlanRewriteRule;
+ import org.apache.tajo.storage.fragment.Fragment;
+ import org.apache.tajo.storage.fragment.FragmentConvertor;
+ 
+ import java.io.IOException;
+ import java.util.List;
+ 
+ /**
+  * Tablespace manages the functions of storing and reading data.
+  * Tablespace is a abstract class.
+  * For supporting such as HDFS, HBASE, a specific Tablespace should be implemented by inheriting this class.
+  *
+  */
+ public abstract class Tablespace {
+ 
+   public static final PathFilter hiddenFileFilter = new PathFilter() {
+     public boolean accept(Path p) {
+       String name = p.getName();
+       return !name.startsWith("_") && !name.startsWith(".");
+     }
+   };
+ 
+   protected TajoConf conf;
+   protected String storeType;
+ 
+   public Tablespace(String storeType) {
+     this.storeType = storeType;
+   }
+ 
+   /**
+    * Initialize storage manager.
+    * @throws java.io.IOException
+    */
+   protected abstract void storageInit() throws IOException;
+ 
+   /**
+    * This method is called after executing "CREATE TABLE" statement.
+    * If a storage is a file based storage, a storage manager may create directory.
+    *
+    * @param tableDesc Table description which is created.
+    * @param ifNotExists Creates the table only when the table does not exist.
+    * @throws java.io.IOException
+    */
+   public abstract void createTable(TableDesc tableDesc, boolean ifNotExists) throws IOException;
+ 
+   /**
+    * This method is called after executing "DROP TABLE" statement with the 'PURGE' option
+    * which is the option to delete all the data.
+    *
+    * @param tableDesc
+    * @throws java.io.IOException
+    */
+   public abstract void purgeTable(TableDesc tableDesc) throws IOException;
+ 
+   /**
+    * Returns the splits that will serve as input for the scan tasks. The
+    * number of splits matches the number of regions in a table.
+    * @param fragmentId The table name or previous ExecutionBlockId
+    * @param tableDesc The table description for the target data.
+    * @param scanNode The logical node for scanning.
+    * @return The list of input fragments.
+    * @throws java.io.IOException
+    */
+   public abstract List<Fragment> getSplits(String fragmentId, TableDesc tableDesc,
+                                            ScanNode scanNode) throws IOException;
+ 
+   /**
+    * It returns the splits that will serve as input for the non-forward query scanner such as 'select * from table1'.
+    * The result list should be small. If there is many fragments for scanning, TajoMaster uses the paging navigation.
+    * @param tableDesc The table description for the target data.
+    * @param currentPage The current page number within the entire list.
+    * @param numFragments The number of fragments in the result.
+    * @return The list of input fragments.
+    * @throws java.io.IOException
+    */
+   public abstract List<Fragment> getNonForwardSplit(TableDesc tableDesc, int currentPage, int numFragments)
+       throws IOException;
+ 
+   /**
+    * It returns the storage property.
+    * @return The storage property
+    */
+   public abstract StorageProperty getStorageProperty();
+ 
+   /**
+    * Release storage manager resource
+    */
+   public abstract void close();
+ 
+ 
+   /**
+    * It is called by a Repartitioner for range shuffling when the SortRangeType of SortNode is USING_STORAGE_MANAGER.
+    * In general Repartitioner determines the partition range using previous output statistics data.
+    * In the special cases, such as HBase Repartitioner uses the result of this method.
+    *
+    * @param queryContext The current query context which contains query properties.
+    * @param tableDesc The table description for the target data.
+    * @param inputSchema The input schema
+    * @param sortSpecs The sort specification that contains the sort column and sort order.
+    * @return The list of sort ranges.
+    * @throws java.io.IOException
+    */
+   public abstract TupleRange[] getInsertSortRanges(OverridableConf queryContext, TableDesc tableDesc,
+                                                    Schema inputSchema, SortSpec[] sortSpecs,
+                                                    TupleRange dataRange) throws IOException;
+ 
+   /**
+    * This method is called before executing 'INSERT' or 'CREATE TABLE as SELECT'.
+    * In general Tajo creates the target table after finishing the final sub-query of CATS.
+    * But In the special cases, such as HBase INSERT or CAST query uses the target table information.
+    * That kind of the storage should implements the logic related to creating table in this method.
+    *
+    * @param node The child node of the root node.
+    * @throws java.io.IOException
+    */
+   public abstract void beforeInsertOrCATS(LogicalNode node) throws IOException;
+ 
+   /**
+    * It is called when the query failed.
+    * Each storage manager should implement to be processed when the query fails in this method.
+    *
+    * @param node The child node of the root node.
+    * @throws java.io.IOException
+    */
+ 
+   /**
+    * Returns the current storage type.
+    * @return
+    */
+   public String getStoreType() {
+     return storeType;
+   }
+ 
+   /**
+    * Initialize Tablespace instance. It should be called before using.
+    *
+    * @param tajoConf
+    * @throws java.io.IOException
+    */
+   public void init(TajoConf tajoConf) throws IOException {
+     this.conf = tajoConf;
+     storageInit();
+   }
+ 
+   /**
+    * Returns the splits that will serve as input for the scan tasks. The
+    * number of splits matches the number of regions in a table.
+    *
+    * @param fragmentId The table name or previous ExecutionBlockId
+    * @param tableDesc The table description for the target data.
+    * @return The list of input fragments.
+    * @throws java.io.IOException
+    */
+   public List<Fragment> getSplits(String fragmentId, TableDesc tableDesc) throws IOException {
+     return getSplits(fragmentId, tableDesc, null);
+   }
+ 
+   /**
+    * Returns Scanner instance.
+    *
+    * @param meta The table meta
+    * @param schema The input schema
+    * @param fragment The fragment for scanning
+    * @param target Columns which are selected.
+    * @return Scanner instance
+    * @throws java.io.IOException
+    */
+   public Scanner getScanner(TableMeta meta, Schema schema, FragmentProto fragment, Schema target) throws IOException {
+     return getScanner(meta, schema, FragmentConvertor.convert(conf, fragment), target);
+   }
+ 
+   /**
+    * Returns Scanner instance.
+    *
+    * @param meta The table meta
+    * @param schema The input schema
+    * @param fragment The fragment for scanning
+    * @return Scanner instance
+    * @throws java.io.IOException
+    */
+   public Scanner getScanner(TableMeta meta, Schema schema, Fragment fragment) throws IOException {
+     return getScanner(meta, schema, fragment, schema);
+   }
+ 
+   /**
+    * Returns Scanner instance.
+    *
+    * @param meta The table meta
+    * @param schema The input schema
+    * @param fragment The fragment for scanning
+    * @param target The output schema
+    * @return Scanner instance
+    * @throws java.io.IOException
+    */
+   public Scanner getScanner(TableMeta meta, Schema schema, Fragment fragment, Schema target) throws IOException {
+     if (fragment.isEmpty()) {
+       Scanner scanner = new NullScanner(conf, schema, meta, fragment);
+       scanner.setTarget(target.toArray());
+ 
+       return scanner;
+     }
+ 
+     Scanner scanner;
+ 
+     Class<? extends Scanner> scannerClass = getScannerClass(meta.getStoreType());
+     scanner = TableSpaceManager.newScannerInstance(scannerClass, conf, schema, meta, fragment);
+     scanner.setTarget(target.toArray());
+ 
+     return scanner;
+   }
+ 
+   /**
++   * Returns Scanner instance.
++   *
++   * @param meta The table meta
++   * @param schema The input schema
++   * @param fragment The fragment for scanning
++   * @param target The output schema
++   * @return Scanner instance
++   * @throws IOException
++   */
++  public synchronized SeekableScanner getSeekableScanner(TableMeta meta, Schema schema, FragmentProto fragment,
++                                                         Schema target) throws IOException {
++    return (SeekableScanner)this.getScanner(meta, schema, fragment, target);
++  }
++
++  /**
+    * Returns Appender instance.
+    * @param queryContext Query property.
+    * @param taskAttemptId Task id.
+    * @param meta Table meta data.
+    * @param schema Output schema.
+    * @param workDir Working directory
+    * @return Appender instance
+    * @throws java.io.IOException
+    */
+   public Appender getAppender(OverridableConf queryContext,
+                               TaskAttemptId taskAttemptId, TableMeta meta, Schema schema, Path workDir)
+       throws IOException {
+     Appender appender;
+ 
+     Class<? extends Appender> appenderClass;
+ 
+     String handlerName = meta.getStoreType().toLowerCase();
+     appenderClass = TableSpaceManager.APPENDER_HANDLER_CACHE.get(handlerName);
+     if (appenderClass == null) {
+       appenderClass = conf.getClass(
+           String.format("tajo.storage.appender-handler.%s.class", handlerName), null, Appender.class);
+       TableSpaceManager.APPENDER_HANDLER_CACHE.put(handlerName, appenderClass);
+     }
+ 
+     if (appenderClass == null) {
+       throw new IOException("Unknown Storage Type: " + meta.getStoreType());
+     }
+ 
+     appender = TableSpaceManager.newAppenderInstance(appenderClass, conf, taskAttemptId, meta, schema, workDir);
+ 
+     return appender;
+   }
+ 
+   /**
+    * Return the Scanner class for the StoreType that is defined in storage-default.xml.
+    *
+    * @param storeType store type
+    * @return The Scanner class
+    * @throws java.io.IOException
+    */
+   public Class<? extends Scanner> getScannerClass(String storeType) throws IOException {
+     String handlerName = storeType.toLowerCase();
+     Class<? extends Scanner> scannerClass = TableSpaceManager.SCANNER_HANDLER_CACHE.get(handlerName);
+     if (scannerClass == null) {
+       scannerClass = conf.getClass(
+           String.format("tajo.storage.scanner-handler.%s.class", handlerName), null, Scanner.class);
+       TableSpaceManager.SCANNER_HANDLER_CACHE.put(handlerName, scannerClass);
+     }
+ 
+     if (scannerClass == null) {
+       throw new IOException("Unknown Storage Type: " + storeType);
+     }
+ 
+     return scannerClass;
+   }
+ 
+   /**
+    * Return length of the fragment.
+    * In the UNKNOWN_LENGTH case get FRAGMENT_ALTERNATIVE_UNKNOWN_LENGTH from the configuration.
+    *
+    * @param conf Tajo system property
+    * @param fragment Fragment
+    * @return
+    */
+   public static long getFragmentLength(TajoConf conf, Fragment fragment) {
+     if (fragment.getLength() == TajoConstants.UNKNOWN_LENGTH) {
+       return conf.getLongVar(ConfVars.FRAGMENT_ALTERNATIVE_UNKNOWN_LENGTH);
+     } else {
+       return fragment.getLength();
+     }
+   }
+ 
+   public abstract void rollbackOutputCommit(LogicalNode node) throws IOException;
+ 
+   /**
+    * It is called after making logical plan. Storage manager should verify the schema for inserting.
+    *
+    * @param tableDesc The table description of insert target.
+    * @param outSchema  The output schema of select query for inserting.
+    * @throws java.io.IOException
+    */
+   public abstract void verifyInsertTableSchema(TableDesc tableDesc, Schema outSchema) throws IOException;
+ 
+   /**
+    * Returns the list of storage specified rewrite rules.
+    * This values are used by LogicalOptimizer.
+    *
+    * @param queryContext The query property
+    * @param tableDesc The description of the target table.
+    * @return The list of storage specified rewrite rules
+    * @throws java.io.IOException
+    */
+   public abstract List<LogicalPlanRewriteRule> getRewriteRules(OverridableConf queryContext, TableDesc tableDesc)
+       throws IOException;
+ 
+   /**
+    * Finalizes result data. Tajo stores result data in the staging directory.
+    * If the query fails, clean up the staging directory.
+    * Otherwise the query is successful, move to the final directory from the staging directory.
+    *
+    * @param queryContext The query property
+    * @param finalEbId The final execution block id
+    * @param plan The query plan
+    * @param schema The final output schema
+    * @param tableDesc The description of the target table
+    * @return Saved path
+    * @throws java.io.IOException
+    */
+   public abstract Path commitOutputData(OverridableConf queryContext, ExecutionBlockId finalEbId,
+                                LogicalPlan plan, Schema schema,
+                                TableDesc tableDesc) throws IOException;
+ }

http://git-wip-us.apache.org/repos/asf/tajo/blob/4d01fca9/tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/index/TestBSTIndex.java
----------------------------------------------------------------------