tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [3/9] git commit: Merge branch 'master' of http://git-wip-us.apache.org/repos/asf/tajo into index_support
Date Fri, 03 Oct 2014 05:07:19 GMT
Merge branch 'master' of http://git-wip-us.apache.org/repos/asf/tajo into index_support

Conflicts:
	tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
	tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
	tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java


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

Branch: refs/heads/index_support
Commit: bf5b43c40f10de2bd47277209a726cfe92776f7b
Parents: 6d6b968 644b7cd
Author: Jihoon Son <jihoonson@apache.org>
Authored: Thu Sep 25 21:13:55 2014 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Thu Sep 25 21:13:55 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |  189 +-
 LICENSE                                         |   56 +
 NOTICE                                          |    6 +
 pom.xml                                         |   52 +-
 tajo-algebra/pom.xml                            |   13 +-
 tajo-catalog/pom.xml                            |   12 +-
 tajo-catalog/tajo-catalog-client/pom.xml        |   13 +-
 .../tajo/catalog/AbstractCatalogClient.java     |   75 +-
 tajo-catalog/tajo-catalog-common/pom.xml        |   13 +-
 .../org/apache/tajo/catalog/CatalogUtil.java    |    2 +-
 .../org/apache/tajo/catalog/FunctionDesc.java   |    2 +-
 .../java/org/apache/tajo/catalog/Schema.java    |   22 +-
 .../java/org/apache/tajo/catalog/TableMeta.java |   14 +-
 .../apache/tajo/catalog/TestKeyValueSet.java    |   84 +-
 tajo-catalog/tajo-catalog-drivers/pom.xml       |   29 +-
 .../tajo-catalog-drivers/tajo-hcatalog/pom.xml  |  364 ++-
 .../tajo/catalog/store/HCatalogStore.java       |   39 +-
 .../catalog/store/HCatalogStoreClientPool.java  |   20 +-
 .../apache/tajo/catalog/store/HCatalogUtil.java |    6 +
 .../tajo/catalog/store/TestHCatalogStore.java   |   12 +-
 tajo-catalog/tajo-catalog-server/pom.xml        |   20 +-
 .../org/apache/tajo/catalog/CatalogServer.java  |    2 +-
 .../org/apache/tajo/catalog/TestCatalog.java    |   10 +-
 tajo-client/pom.xml                             |   14 +-
 .../tajo/cli/DefaultTajoCliOutputFormatter.java |   16 +-
 .../java/org/apache/tajo/cli/HelpCommand.java   |  100 +-
 .../java/org/apache/tajo/cli/SetCommand.java    |   78 +-
 .../main/java/org/apache/tajo/cli/TajoCli.java  |  212 +-
 .../apache/tajo/cli/TajoCliOutputFormatter.java |    5 +-
 .../org/apache/tajo/cli/TajoGetConfCommand.java |   57 +
 .../org/apache/tajo/cli/TajoHAAdminCommand.java |   57 +
 .../org/apache/tajo/cli/TajoShellCommand.java   |   10 +-
 .../org/apache/tajo/cli/VersionCommand.java     |    4 +-
 .../java/org/apache/tajo/client/TajoAdmin.java  |   73 +-
 .../java/org/apache/tajo/client/TajoClient.java |  241 +-
 .../org/apache/tajo/client/TajoGetConf.java     |  159 ++
 .../org/apache/tajo/client/TajoHAAdmin.java     |  210 ++
 .../apache/tajo/client/TajoHAClientUtil.java    |   87 +
 .../org/apache/tajo/jdbc/FetchResultSet.java    |   91 +
 .../org/apache/tajo/jdbc/TajoResultSet.java     |    2 +-
 .../org/apache/tajo/jdbc/TajoResultSetBase.java |    2 +-
 tajo-client/src/main/proto/ClientProtos.proto   |   66 +-
 .../main/proto/TajoMasterClientProtocol.proto   |    4 +-
 tajo-common/pom.xml                             |   28 +-
 .../main/java/org/apache/tajo/ConfigKey.java    |   52 +
 .../java/org/apache/tajo/OverridableConf.java   |  247 ++
 .../main/java/org/apache/tajo/SessionVars.java  |  214 ++
 .../java/org/apache/tajo/TajoConstants.java     |    6 +-
 .../java/org/apache/tajo/conf/TajoConf.java     |  227 +-
 .../java/org/apache/tajo/datum/CharDatum.java   |    5 +-
 .../main/java/org/apache/tajo/datum/Datum.java  |   83 +-
 .../org/apache/tajo/datum/DatumFactory.java     |   32 +-
 .../java/org/apache/tajo/datum/Float4Datum.java |   63 +-
 .../java/org/apache/tajo/datum/Float8Datum.java |   81 +-
 .../java/org/apache/tajo/datum/Inet4Datum.java  |    5 +
 .../java/org/apache/tajo/datum/Int2Datum.java   |   79 +-
 .../java/org/apache/tajo/datum/Int4Datum.java   |   81 +-
 .../java/org/apache/tajo/datum/Int8Datum.java   |   81 +-
 .../org/apache/tajo/datum/IntervalDatum.java    |   16 +-
 .../java/org/apache/tajo/datum/NullDatum.java   |    6 +
 .../java/org/apache/tajo/datum/TextDatum.java   |   20 +-
 .../java/org/apache/tajo/unit/StorageUnit.java  |    2 +-
 .../java/org/apache/tajo/util/BitArray.java     |    2 +-
 .../main/java/org/apache/tajo/util/Bytes.java   | 1184 ++++----
 .../java/org/apache/tajo/util/BytesUtils.java   |  217 ++
 .../org/apache/tajo/util/CommonTestingUtil.java |   24 +-
 .../org/apache/tajo/util/HAServiceUtil.java     |  293 ++
 .../java/org/apache/tajo/util/KeyValueSet.java  |  165 +-
 .../java/org/apache/tajo/util/MurmurHash.java   |  213 ++
 .../java/org/apache/tajo/util/NumberUtil.java   |  348 ++-
 .../main/java/org/apache/tajo/util/Pair.java    |   44 +-
 .../java/org/apache/tajo/util/StringUtils.java  |  130 +
 .../apache/tajo/util/datetime/DateTimeUtil.java |   35 +
 tajo-common/src/main/proto/tajo_protos.proto    |   10 +
 .../tajo/datum/TestArithmeticOperator.java      |  377 +++
 .../org/apache/tajo/datum/TestTextDatum.java    |   36 +-
 .../java/org/apache/tajo/util/TestBytes.java    |  111 -
 .../org/apache/tajo/util/TestNumberUtil.java    |   47 +-
 .../org/apache/tajo/util/TestStringUtil.java    |   40 +-
 tajo-core/pom.xml                               |   35 +-
 .../java/org/apache/tajo/benchmark/TPCH.java    |   32 +-
 .../tajo/engine/codegen/CaseWhenEmitter.java    |  210 ++
 .../engine/codegen/CaseWhenSwitchGenerator.java |   92 +
 .../tajo/engine/codegen/CodeGenUtils.java       |   41 +
 .../tajo/engine/codegen/CompilationError.java   |   31 +
 .../tajo/engine/codegen/EvalCodeEmitter.java    |   27 +
 .../tajo/engine/codegen/EvalCodeGenContext.java |  223 ++
 .../tajo/engine/codegen/EvalCodeGenerator.java  |  840 ++++++
 .../engine/codegen/ExecutorPreCompiler.java     |  213 ++
 .../tajo/engine/codegen/TajoClassLoader.java    |   30 +
 .../engine/codegen/TajoGeneratorAdapter.java    |  953 +++++++
 .../engine/codegen/VariablesPreBuilder.java     |   83 +
 .../apache/tajo/engine/eval/AlgebraicUtil.java  |    6 +-
 .../tajo/engine/eval/BetweenPredicateEval.java  |   26 +
 .../org/apache/tajo/engine/eval/BinaryEval.java |   21 +-
 .../apache/tajo/engine/eval/CaseWhenEval.java   |   38 +-
 .../org/apache/tajo/engine/eval/ConstEval.java  |   12 +-
 .../org/apache/tajo/engine/eval/EvalNode.java   |    6 +-
 .../apache/tajo/engine/eval/EvalTreeUtil.java   |  107 +-
 .../org/apache/tajo/engine/eval/EvalType.java   |   56 +-
 .../org/apache/tajo/engine/eval/FieldEval.java  |   12 +-
 .../apache/tajo/engine/eval/FunctionEval.java   |   31 +-
 .../tajo/engine/eval/LikePredicateEval.java     |    4 +
 .../engine/eval/PatternMatchPredicateEval.java  |    8 +
 .../tajo/engine/eval/RowConstantEval.java       |   10 +
 .../engine/eval/SimilarToPredicateEval.java     |    5 +
 .../tajo/engine/eval/SimpleEvalNodeVisitor.java |   27 +-
 .../org/apache/tajo/engine/eval/UnaryEval.java  |   11 +
 .../exception/RangeOverflowException.java       |    5 +-
 .../function/builtin/CoalesceBoolean.java       |    4 +-
 .../engine/function/builtin/CoalesceDate.java   |    3 +-
 .../engine/function/builtin/CoalesceDouble.java |    3 +-
 .../engine/function/builtin/CoalesceLong.java   |    3 +-
 .../engine/function/builtin/CoalesceString.java |    3 +-
 .../engine/function/builtin/CoalesceTime.java   |    3 +-
 .../function/builtin/CoalesceTimestamp.java     |    3 +-
 .../function/builtin/CountValueDistinct.java    |    4 +-
 .../apache/tajo/engine/function/math/Round.java |    7 +-
 .../tajo/engine/function/math/RoundFloat8.java  |   39 +-
 .../eval/EvalTreeOptimizationRule.java          |   27 +
 .../optimizer/eval/EvalTreeOptimizer.java       |   76 +
 .../tajo/engine/optimizer/eval/Prioritized.java |   30 +
 .../optimizer/eval/rules/ConstantFolding.java   |   92 +
 .../eval/rules/ConstantPropagation.java         |  112 +
 .../engine/plan/EvalTreeProtoDeserializer.java  |  218 ++
 .../engine/plan/EvalTreeProtoSerializer.java    |  308 ++
 .../tajo/engine/planner/ExprAnnotator.java      |   49 +-
 .../apache/tajo/engine/planner/ExprFinder.java  |    2 +-
 .../tajo/engine/planner/ExprNormalizer.java     |   15 +-
 .../tajo/engine/planner/LogicalOptimizer.java   |    9 +-
 .../apache/tajo/engine/planner/LogicalPlan.java |  316 +--
 .../engine/planner/LogicalPlanPreprocessor.java |  162 +-
 .../engine/planner/LogicalPlanVerifier.java     |   12 +-
 .../tajo/engine/planner/LogicalPlanner.java     |  195 +-
 .../tajo/engine/planner/NamedExprsManager.java  |   15 +-
 .../engine/planner/PhysicalPlannerImpl.java     |   55 +-
 .../apache/tajo/engine/planner/PlannerUtil.java |  140 +-
 .../engine/planner/PreLogicalPlanVerifier.java  |   25 +-
 .../apache/tajo/engine/planner/Projector.java   |   33 +-
 .../engine/planner/RangePartitionAlgorithm.java |  130 +-
 .../tajo/engine/planner/TypeDeterminant.java    |   41 +-
 .../engine/planner/UniformRangePartition.java   |  479 +++-
 .../engine/planner/global/GlobalPlanner.java    |   18 +-
 .../tajo/engine/planner/logical/HavingNode.java |   15 +-
 .../planner/logical/PersistentStoreNode.java    |    2 +-
 .../tajo/engine/planner/logical/ScanNode.java   |   12 +-
 .../engine/planner/logical/SelectableNode.java  |   48 +
 .../engine/planner/logical/SelectionNode.java   |   15 +-
 .../planner/logical/TableSubQueryNode.java      |    1 -
 .../engine/planner/logical/join/JoinGraph.java  |    2 +-
 .../planner/nameresolver/NameResolver.java      |  291 ++
 .../planner/nameresolver/NameResolvingMode.java |   80 +
 .../planner/nameresolver/ResolverByLegacy.java  |  126 +
 .../planner/nameresolver/ResolverByRels.java    |   38 +
 .../nameresolver/ResolverByRelsAndSubExprs.java |   42 +
 .../nameresolver/ResolverBySubExprsAndRels.java |   42 +
 .../engine/planner/physical/BNLJoinExec.java    |    9 +-
 .../planner/physical/BSTIndexScanExec.java      |    2 +-
 .../physical/BasicPhysicalExecutorVisitor.java  |    2 +
 .../planner/physical/BinaryPhysicalExec.java    |    2 +
 .../planner/physical/ColPartitionStoreExec.java |   58 +-
 .../planner/physical/ExternalSortExec.java      |  100 +-
 .../HashBasedColPartitionStoreExec.java         |    9 +-
 .../planner/physical/HashFullOuterJoinExec.java |    8 +-
 .../engine/planner/physical/HashJoinExec.java   |    7 +-
 .../planner/physical/HashLeftOuterJoinExec.java |    7 +-
 .../planner/physical/HashLeftSemiJoinExec.java  |    4 +
 .../planner/physical/HashPartitioner.java       |    3 +-
 .../physical/HashShuffleFileWriteExec.java      |  125 +-
 .../physical/MergeFullOuterJoinExec.java        |    7 +-
 .../engine/planner/physical/MergeJoinExec.java  |    7 +-
 .../engine/planner/physical/NLJoinExec.java     |    2 +-
 .../planner/physical/NLLeftOuterJoinExec.java   |    2 +-
 .../physical/PartitionMergeScanExec.java        |    5 +-
 .../engine/planner/physical/PhysicalExec.java   |   11 +-
 .../physical/PhysicalExecutorVisitor.java       |    2 +
 .../planner/physical/PhysicalPlanUtil.java      |   64 +
 .../physical/PhysicalPlanningException.java     |   31 -
 .../engine/planner/physical/ProjectionExec.java |    2 +-
 .../physical/RightOuterMergeJoinExec.java       |    7 +-
 .../engine/planner/physical/SelectionExec.java  |    8 +-
 .../engine/planner/physical/SeqScanExec.java    |   34 +-
 .../SortBasedColPartitionStoreExec.java         |   43 +-
 .../engine/planner/physical/StoreTableExec.java |   64 +-
 .../planner/physical/UnaryPhysicalExec.java     |    5 +
 .../planner/rewrite/FilterPushDownRule.java     |   19 +-
 .../planner/rewrite/ProjectionPushDownRule.java |   12 +-
 .../apache/tajo/engine/query/QueryContext.java  |  144 +-
 .../tajo/engine/query/QueryUnitRequestImpl.java |    5 +-
 .../apache/tajo/engine/utils/SchemaUtil.java    |   20 +-
 .../org/apache/tajo/engine/utils/TupleUtil.java |    3 +-
 .../tajo/master/DefaultTaskScheduler.java       |   68 +-
 .../org/apache/tajo/master/GlobalEngine.java    |  135 +-
 .../tajo/master/LaunchTaskRunnersEvent.java     |   45 +
 .../apache/tajo/master/LazyTaskScheduler.java   |    4 +-
 .../master/NonForwardQueryResultScanner.java    |  165 ++
 .../apache/tajo/master/TajoContainerProxy.java  |   43 +-
 .../java/org/apache/tajo/master/TajoMaster.java |   42 +-
 .../tajo/master/TajoMasterClientService.java    |  114 +-
 .../apache/tajo/master/TajoMasterService.java   |    9 +-
 .../master/cluster/WorkerConnectionInfo.java    |  178 ++
 .../master/event/TaskAttemptAssignedEvent.java  |   17 +-
 .../tajo/master/event/TaskRequestEvent.java     |   13 +-
 .../org/apache/tajo/master/ha/HAService.java    |   56 +
 .../tajo/master/ha/HAServiceHDFSImpl.java       |  278 ++
 .../apache/tajo/master/ha/TajoMasterInfo.java   |   89 +
 .../apache/tajo/master/querymaster/Query.java   |   32 +-
 .../master/querymaster/QueryInProgress.java     |    6 +-
 .../master/querymaster/QueryJobManager.java     |   11 +-
 .../tajo/master/querymaster/QueryMaster.java    |  170 +-
 .../querymaster/QueryMasterManagerService.java  |   23 +-
 .../master/querymaster/QueryMasterTask.java     |   58 +-
 .../tajo/master/querymaster/QueryUnit.java      |  105 +-
 .../master/querymaster/QueryUnitAttempt.java    |   32 +-
 .../tajo/master/querymaster/Repartitioner.java  |  503 +++-
 .../tajo/master/querymaster/SubQuery.java       |  242 +-
 .../apache/tajo/master/rm/TajoRMContext.java    |   14 +-
 .../tajo/master/rm/TajoResourceTracker.java     |   24 +-
 .../master/rm/TajoWorkerResourceManager.java    |   33 +-
 .../java/org/apache/tajo/master/rm/Worker.java  |   73 +-
 .../org/apache/tajo/master/rm/WorkerEvent.java  |    6 +-
 .../tajo/master/rm/WorkerLivelinessMonitor.java |    4 +-
 .../tajo/master/rm/WorkerReconnectEvent.java    |    2 +-
 .../tajo/master/rm/WorkerResourceManager.java   |    6 +-
 .../tajo/master/rm/WorkerStatusEvent.java       |    2 +-
 .../org/apache/tajo/master/session/Session.java |  112 +-
 .../session/SessionLivelinessMonitor.java       |    2 +-
 .../tajo/master/session/SessionManager.java     |   13 +-
 .../tajo/webapp/QueryExecutorServlet.java       |  205 +-
 .../tajo/worker/AbstractResourceAllocator.java  |   15 +
 .../tajo/worker/ExecutionBlockContext.java      |  448 +++
 .../worker/ExecutionBlockSharedResource.java    |  123 +
 .../java/org/apache/tajo/worker/FetchImpl.java  |   79 +-
 .../java/org/apache/tajo/worker/Fetcher.java    |   76 +-
 .../tajo/worker/TajoResourceAllocator.java      |  103 +-
 .../java/org/apache/tajo/worker/TajoWorker.java |  250 +-
 .../tajo/worker/TajoWorkerClientService.java    |   18 +-
 .../tajo/worker/TajoWorkerManagerService.java   |   64 +-
 .../main/java/org/apache/tajo/worker/Task.java  |  492 ++--
 .../apache/tajo/worker/TaskAttemptContext.java  |  123 +-
 .../java/org/apache/tajo/worker/TaskRunner.java |  282 +-
 .../apache/tajo/worker/TaskRunnerManager.java   |  140 +-
 .../tajo/worker/WorkerHeartbeatService.java     |  114 +-
 .../tajo/worker/event/TaskRunnerEvent.java      |   41 +
 .../tajo/worker/event/TaskRunnerStartEvent.java |   59 +
 .../tajo/worker/event/TaskRunnerStopEvent.java  |   28 +
 tajo-core/src/main/proto/Plan.proto             |  209 ++
 .../src/main/proto/QueryMasterProtocol.proto    |    3 +-
 .../main/proto/ResourceTrackerProtocol.proto    |   12 +-
 .../src/main/proto/TajoMasterProtocol.proto     |   36 +-
 .../src/main/proto/TajoWorkerProtocol.proto     |   57 +-
 .../resources/webapps/admin/catalogview.jsp     |   13 +-
 .../main/resources/webapps/admin/cluster.jsp    |  139 +-
 .../src/main/resources/webapps/admin/index.jsp  |   51 +-
 .../src/main/resources/webapps/admin/query.jsp  |   21 +-
 .../resources/webapps/admin/query_executor.jsp  |   13 +-
 .../resources/webapps/worker/querydetail.jsp    |   10 +
 .../resources/webapps/worker/querytasks.jsp     |    9 +-
 .../resources/webapps/worker/taskdetail.jsp     |    2 +
 .../src/main/resources/webapps/worker/tasks.jsp |    4 +-
 .../apache/tajo/LocalTajoTestingUtility.java    |    9 +
 .../java/org/apache/tajo/QueryTestCaseBase.java |    2 +-
 .../org/apache/tajo/TajoTestingCluster.java     |  125 +-
 .../test/java/org/apache/tajo/TpchTestBase.java |    2 +-
 .../tajo/cli/TestDefaultCliOutputFormatter.java |   47 +-
 .../java/org/apache/tajo/cli/TestTajoCli.java   |  185 +-
 .../org/apache/tajo/client/TestTajoClient.java  |   10 +-
 .../tajo/cluster/TestWorkerConnectionInfo.java  |   36 +
 .../engine/codegen/TestEvalCodeGenerator.java   |  311 ++
 .../engine/codegen/TestGeneratorAdapter.java    |   41 +
 .../apache/tajo/engine/eval/ExprTestBase.java   |  113 +-
 .../apache/tajo/engine/eval/TestEvalTree.java   |   21 +-
 .../tajo/engine/eval/TestEvalTreeUtil.java      |   39 +-
 .../apache/tajo/engine/eval/TestPredicates.java |   17 +
 .../tajo/engine/eval/TestSQLExpression.java     |   24 +-
 .../function/TestConditionalExpressions.java    |  123 +-
 .../tajo/engine/function/TestMathFunctions.java |   34 +-
 .../function/TestPatternMatchingPredicates.java |    2 +-
 .../engine/planner/TestLogicalOptimizer.java    |   20 +-
 .../tajo/engine/planner/TestLogicalPlan.java    |   37 +-
 .../tajo/engine/planner/TestLogicalPlanner.java |  138 +-
 .../tajo/engine/planner/TestPlannerUtil.java    |   67 +-
 .../planner/TestUniformRangePartition.java      |  764 ++++-
 .../planner/global/TestBroadcastJoinPlan.java   |  156 +-
 .../planner/physical/TestBNLJoinExec.java       |    9 +-
 .../planner/physical/TestBSTIndexExec.java      |    4 +-
 .../planner/physical/TestExternalSortExec.java  |    4 +-
 .../physical/TestFullOuterHashJoinExec.java     |   24 +-
 .../physical/TestFullOuterMergeJoinExec.java    |   29 +-
 .../planner/physical/TestHashAntiJoinExec.java  |    4 +-
 .../planner/physical/TestHashJoinExec.java      |   19 +-
 .../planner/physical/TestHashPartitioner.java   |   39 +-
 .../planner/physical/TestHashSemiJoinExec.java  |    4 +-
 .../physical/TestLeftOuterHashJoinExec.java     |   28 +-
 .../physical/TestLeftOuterNLJoinExec.java       |   25 +-
 .../planner/physical/TestMergeJoinExec.java     |    4 +-
 .../engine/planner/physical/TestNLJoinExec.java |   17 +-
 .../planner/physical/TestPhysicalPlanner.java   |  339 ++-
 .../physical/TestProgressExternalSortExec.java  |    4 +-
 .../physical/TestRightOuterHashJoinExec.java    |   16 +-
 .../physical/TestRightOuterMergeJoinExec.java   |   32 +-
 .../engine/planner/physical/TestSortExec.java   |    4 +-
 .../tajo/engine/query/TestCaseByCases.java      |   45 +-
 .../tajo/engine/query/TestGroupByQuery.java     |  213 +-
 .../tajo/engine/query/TestInsertQuery.java      |   70 +
 .../tajo/engine/query/TestJoinBroadcast.java    |   95 +-
 .../apache/tajo/engine/query/TestJoinQuery.java |  118 +-
 .../tajo/engine/query/TestNullValues.java       |   46 +-
 .../tajo/engine/query/TestSelectQuery.java      |  107 +-
 .../apache/tajo/engine/query/TestSortQuery.java |   98 +-
 .../tajo/engine/query/TestTablePartitions.java  |  115 +
 .../tajo/engine/query/TestWindowQuery.java      |    7 +
 .../org/apache/tajo/jdbc/TestResultSet.java     |   12 +-
 .../java/org/apache/tajo/jdbc/TestTajoJdbc.java |   95 +-
 .../tajo/master/TestExecutionBlockCursor.java   |    6 +-
 .../apache/tajo/master/TestGlobalPlanner.java   |   72 +-
 .../apache/tajo/master/TestRepartitioner.java   |  394 ++-
 .../tajo/master/ha/TestHAServiceHDFSImpl.java   |  133 +
 .../querymaster/TestIntermediateEntry.java      |   53 +
 .../tajo/master/querymaster/TestKillQuery.java  |  108 +
 .../querymaster/TestQueryUnitStatusUpdate.java  |    8 +-
 .../tajo/master/rm/TestTajoResourceManager.java |    8 +-
 .../tajo/scheduler/TestFifoScheduler.java       |   47 +-
 .../apache/tajo/worker/TestDeletionService.java |   61 +
 .../org/apache/tajo/worker/TestFetcher.java     |   82 +-
 .../tajo/worker/TestRangeRetrieverHandler.java  |    8 +-
 .../TestTablePartitions/lineitemspecial.tbl     |    5 +
 .../TestCaseByCases/testTAJO914Case1.sql        |   10 +
 .../TestCaseByCases/testTAJO914Case2.sql        |    9 +
 .../TestCaseByCases/testTAJO914Case3.sql        |   10 +
 .../TestCaseByCases/testTAJO914Case4.sql        |   10 +
 .../TestCaseByCases/testTAJO917Case1.sql        |   13 +
 .../testDistinctAggregationCaseByCase3.sql      |    8 +
 .../testDistinctAggregationCaseByCase4.sql      |    7 +
 .../testGroupByWithConstantKeys3.sql            |    8 +
 .../testGroupByWithConstantKeys4.sql            |   12 +
 .../testGroupByWithConstantKeys5.sql            |   13 +
 .../testGroupByWithSameConstantKeys1.sql        |    2 +-
 .../testGroupByWithSameExprs1.sql               |    2 +
 .../testGroupByWithSameExprs2.sql               |    4 +-
 .../testHavingWithNamedTarget.sql               |   14 +-
 .../testLeftOuterJoinWithConstantExpr4.sql      |    6 +
 .../testLeftOuterJoinWithConstantExpr5.sql      |    9 +
 .../queries/TestSelectQuery/customer_ddl.sql    |    9 +
 .../TestSelectQuery/insert_into_customer.sql    |   11 +
 .../TestSelectQuery/testCaseWhenRound.sql       |    8 +
 .../testColumnEqualityButNotJoinCondition1.sql  |    7 +
 .../testColumnEqualityButNotJoinCondition2.sql  |    7 +
 .../TestSelectQuery/testNonQualifiedNames.sql   |    1 +
 ...testSelectColumnAliasExistingInRelation1.sql |    1 +
 ...testSelectColumnAliasExistingInRelation2.sql |    1 +
 ...testSelectColumnAliasExistingInRelation3.sql |   19 +
 ...SelectSameConstantsWithDifferentAliases3.sql |   10 +
 ...testSimpleQueryWithLimitPartitionedTable.sql |    1 +
 .../TestSortQuery/testSortOnNullColumn.sql      |   13 +
 .../TestSortQuery/testSortOnUnicodeTextAsc.sql  |    6 +
 .../TestSortQuery/testSortOnUnicodeTextDesc.sql |    6 +
 .../TestSortQuery/testSortWithConstKeys.sql     |   10 +
 .../TestTablePartitions/lineitemspecial_ddl.sql |    3 +
 .../queries/TestWindowQuery/testWindow8.sql     |    7 +
 .../TestCaseByCases/testTAJO914Case1.result     |    5 +
 .../TestCaseByCases/testTAJO914Case2.result     |    5 +
 .../TestCaseByCases/testTAJO914Case3.result     |    5 +
 .../TestCaseByCases/testTAJO914Case4.result     |    5 +
 .../TestCaseByCases/testTAJO917Case1.result     |    7 +
 .../testDistinctAggregationCaseByCase3.result   |    3 +
 .../testDistinctAggregationCaseByCase4.result   |    3 +
 .../TestGroupByQuery/testGroupBy2.result        |    4 +-
 .../testGroupByWithConstantKeys3.result         |    3 +
 .../testGroupByWithConstantKeys4.result         |    5 +
 .../testGroupByWithConstantKeys5.result         |    5 +
 .../testGroupByWithSameConstantKeys1.result     |    4 +-
 .../TestGroupByQuery/testGroupbyWithJson.result |    4 +-
 .../testHavingWithNamedTarget.result            |    4 +-
 ...estBroadcastMultiColumnPartitionTable.result |    4 +-
 .../testLeftOuterJoinWithConstantExpr4.result   |    7 +
 .../testLeftOuterJoinWithConstantExpr5.result   |    6 +
 .../TestSelectQuery/testCaseWhenRound.result    |   22 +
 ...estColumnEqualityButNotJoinCondition1.result |    3 +
 ...estColumnEqualityButNotJoinCondition2.result |    6 +
 .../testNonQualifiedNames.result                |    7 +
 .../TestSelectQuery/testSelectAsterisk5.result  |    2 +-
 ...tSelectColumnAliasExistingInRelation1.result |    4 +
 ...tSelectColumnAliasExistingInRelation2.result |    7 +
 ...tSelectColumnAliasExistingInRelation3.result |   11 +
 ...ectSameConstantsWithDifferentAliases3.result |    7 +
 ...tSimpleQueryWithLimitPartitionedTable.result |   12 +
 .../TestSortQuery/testSortOnNullColumn.result   |    6 +
 .../testSortOnUnicodeTextAsc.result             |    6 +
 .../testSortOnUnicodeTextDesc.result            |    6 +
 .../TestSortQuery/testSortWithConstKeys.result  |    7 +
 .../TestSpecialCharPartitionKeys1.result        |    4 +
 .../TestSpecialCharPartitionKeys2.result        |    3 +
 .../TestTajoCli/testHelpSessionVars.result      |   38 +
 .../testLocalQueryWithoutFrom.result            |    4 +-
 ...estSelectResultWithNullTrueDeprecated.result |    9 +
 .../testStopWhenErrorDeprecated.result          |    6 +
 .../results/TestWindowQuery/testWindow8.result  |    7 +
 tajo-dist/pom.xml                               |   22 +
 tajo-dist/src/main/bin/start-tajo.sh            |   18 +-
 tajo-dist/src/main/bin/stop-tajo.sh             |   19 +-
 tajo-dist/src/main/bin/tajo                     |   26 +-
 tajo-dist/src/main/bin/tajo-daemon.sh           |    1 +
 tajo-dist/src/main/bin/tajo-daemons.sh          |    1 +
 tajo-dist/src/main/conf/tajo-env.sh             |   13 +-
 tajo-docs/pom.xml                               |   18 +
 tajo-docs/src/main/sphinx/configuration.rst     |    3 +-
 .../configuration/catalog_configuration.rst     |    2 +-
 .../sphinx/configuration/ha_configuration.rst   |  135 +
 .../functions/math_func_and_operators.rst       |  276 +-
 tajo-jdbc/pom.xml                               |   13 +-
 .../org/apache/tajo/jdbc/MetaDataTuple.java     |   11 +
 .../org/apache/tajo/jdbc/TajoConnection.java    |    8 +-
 .../apache/tajo/jdbc/TajoDatabaseMetaData.java  |    4 +-
 .../apache/tajo/jdbc/TajoPreparedStatement.java |   16 +-
 .../org/apache/tajo/jdbc/TajoStatement.java     |   76 +-
 tajo-maven-plugins/pom.xml                      |   12 +
 tajo-project/pom.xml                            |   60 +-
 tajo-project/src/site/apt/index.apt             |    2 +
 tajo-rpc/pom.xml                                |   12 +
 .../org/apache/tajo/rpc/AsyncRpcClient.java     |   11 +-
 .../org/apache/tajo/rpc/AsyncRpcServer.java     |    4 +-
 .../org/apache/tajo/rpc/BlockingRpcClient.java  |   13 +-
 .../org/apache/tajo/rpc/NettyClientBase.java    |   86 +-
 .../apache/tajo/rpc/RemoteCallException.java    |    3 +
 .../org/apache/tajo/rpc/RpcConnectionPool.java  |   24 +-
 .../java/org/apache/tajo/rpc/TestAsyncRpc.java  |   91 +-
 .../org/apache/tajo/rpc/TestBlockingRpc.java    |   73 +-
 tajo-storage/pom.xml                            |   18 +-
 .../tajo/storage/AbstractStorageManager.java    |    1 -
 .../java/org/apache/tajo/storage/Appender.java  |    2 +
 .../java/org/apache/tajo/storage/CSVFile.java   |   17 +-
 .../org/apache/tajo/storage/FileAppender.java   |    4 +
 .../org/apache/tajo/storage/FrameTuple.java     |   11 +
 .../tajo/storage/HashShuffleAppender.java       |  209 ++
 .../storage/HashShuffleAppenderManager.java     |  225 ++
 .../java/org/apache/tajo/storage/LazyTuple.java |   14 +-
 .../java/org/apache/tajo/storage/RawFile.java   |   72 +-
 .../java/org/apache/tajo/storage/RowFile.java   |    3 +-
 .../org/apache/tajo/storage/RowStoreUtil.java   |   46 +-
 .../org/apache/tajo/storage/StorageUtil.java    |   59 +-
 .../storage/TextSerializerDeserializer.java     |    7 +-
 .../java/org/apache/tajo/storage/Tuple.java     |    5 +
 .../org/apache/tajo/storage/TupleRange.java     |   29 +-
 .../java/org/apache/tajo/storage/VTuple.java    |   11 +
 .../org/apache/tajo/storage/avro/AvroUtil.java  |   17 +-
 .../apache/tajo/storage/index/bst/BSTIndex.java |   16 +-
 .../tajo/storage/parquet/ParquetAppender.java   |   15 +-
 .../org/apache/tajo/storage/rcfile/RCFile.java  |   15 +-
 .../sequencefile/SequenceFileAppender.java      |   38 +-
 .../sequencefile/SequenceFileScanner.java       |   25 +-
 .../parquet/InternalParquetRecordWriter.java    |    4 +
 .../thirdparty/parquet/ParquetWriter.java       |    4 +
 .../apache/tajo/storage/v2/CSVFileScanner.java  |    8 +-
 .../java/org/apache/tajo/storage/v2/RCFile.java |    6 +-
 .../apache/tajo/storage/v2/RCFileScanner.java   |    2 +-
 .../tajo/storage/TestCompressionStorages.java   |   10 +
 .../org/apache/tajo/storage/TestLazyTuple.java  |    6 +-
 .../org/apache/tajo/storage/TestStorages.java   |   13 +
 .../tajo/storage/parquet/TestReadWrite.java     |    7 +-
 tajo-thirdparty/asm/pom.xml                     |  180 ++
 .../org/objectweb/asm/AnnotationVisitor.java    |  169 ++
 .../org/objectweb/asm/AnnotationWriter.java     |  318 +++
 .../tajo/org/objectweb/asm/Attribute.java       |  255 ++
 .../tajo/org/objectweb/asm/ByteVector.java      |  312 ++
 .../tajo/org/objectweb/asm/ClassReader.java     | 2202 ++++++++++++++
 .../tajo/org/objectweb/asm/ClassVisitor.java    |  286 ++
 .../tajo/org/objectweb/asm/ClassWriter.java     | 1706 +++++++++++
 .../apache/tajo/org/objectweb/asm/Context.java  |  110 +
 .../org/apache/tajo/org/objectweb/asm/Edge.java |   75 +
 .../tajo/org/objectweb/asm/FieldVisitor.java    |  121 +
 .../tajo/org/objectweb/asm/FieldWriter.java     |  273 ++
 .../apache/tajo/org/objectweb/asm/Frame.java    | 1453 ++++++++++
 .../apache/tajo/org/objectweb/asm/Handle.java   |  170 ++
 .../apache/tajo/org/objectweb/asm/Handler.java  |  121 +
 .../org/apache/tajo/org/objectweb/asm/Item.java |  311 ++
 .../apache/tajo/org/objectweb/asm/Label.java    |  560 ++++
 .../tajo/org/objectweb/asm/MethodVisitor.java   |  662 +++++
 .../tajo/org/objectweb/asm/MethodWriter.java    | 2685 ++++++++++++++++++
 .../apache/tajo/org/objectweb/asm/Opcodes.java  |  358 +++
 .../org/apache/tajo/org/objectweb/asm/Type.java |  895 ++++++
 .../tajo/org/objectweb/asm/attrs/package.html   |   66 +
 .../objectweb/asm/commons/AdviceAdapter.java    |  625 ++++
 .../objectweb/asm/commons/AnalyzerAdapter.java  |  920 ++++++
 .../asm/commons/CodeSizeEvaluator.java          |  217 ++
 .../objectweb/asm/commons/GeneratorAdapter.java | 1641 +++++++++++
 .../asm/commons/InstructionAdapter.java         | 1090 +++++++
 .../asm/commons/JSRInlinerAdapter.java          |  746 +++++
 .../asm/commons/LocalVariablesSorter.java       |  361 +++
 .../tajo/org/objectweb/asm/commons/Method.java  |  282 ++
 .../org/objectweb/asm/commons/Remapper.java     |  223 ++
 .../asm/commons/RemappingAnnotationAdapter.java |   79 +
 .../asm/commons/RemappingClassAdapter.java      |  126 +
 .../asm/commons/RemappingFieldAdapter.java      |   62 +
 .../asm/commons/RemappingMethodAdapter.java     |  161 ++
 .../asm/commons/RemappingSignatureAdapter.java  |  155 +
 .../asm/commons/SerialVersionUIDAdder.java      |  533 ++++
 .../objectweb/asm/commons/SimpleRemapper.java   |   69 +
 .../objectweb/asm/commons/StaticInitMerger.java |   96 +
 .../asm/commons/TableSwitchGenerator.java       |   57 +
 .../asm/commons/TryCatchBlockSorter.java        |   92 +
 .../tajo/org/objectweb/asm/commons/package.html |   66 +
 .../optimizer/AnnotationConstantsCollector.java |  147 +
 .../asm/optimizer/ClassConstantsCollector.java  |  184 ++
 .../objectweb/asm/optimizer/ClassOptimizer.java |  167 ++
 .../org/objectweb/asm/optimizer/Constant.java   |  323 +++
 .../objectweb/asm/optimizer/ConstantPool.java   |  249 ++
 .../asm/optimizer/FieldConstantsCollector.java  |   75 +
 .../objectweb/asm/optimizer/JarOptimizer.java   |  234 ++
 .../asm/optimizer/MethodConstantsCollector.java |  161 ++
 .../asm/optimizer/MethodOptimizer.java          |  167 ++
 .../objectweb/asm/optimizer/NameMapping.java    |  114 +
 .../org/objectweb/asm/optimizer/Shrinker.java   |  283 ++
 .../objectweb/asm/optimizer/jdk1.2.2_017.txt.gz |  Bin 0 -> 113814 bytes
 .../objectweb/asm/optimizer/jdk1.3.1_19.txt.gz  |  Bin 0 -> 128067 bytes
 .../asm/optimizer/shrink-annotations.properties |   71 +
 .../asm/optimizer/shrink-frames.properties      |   80 +
 .../asm/optimizer/shrink-resize.properties      |   55 +
 .../asm/optimizer/shrink-signatures.properties  |   61 +
 .../asm/optimizer/shrink-writer.properties      |   84 +
 .../objectweb/asm/optimizer/shrink.properties   |  372 +++
 .../apache/tajo/org/objectweb/asm/package.html  |  105 +
 .../asm/signature/SignatureReader.java          |  228 ++
 .../asm/signature/SignatureVisitor.java         |  235 ++
 .../asm/signature/SignatureWriter.java          |  227 ++
 .../org/objectweb/asm/signature/package.html    |   54 +
 .../objectweb/asm/tree/AbstractInsnNode.java    |  248 ++
 .../org/objectweb/asm/tree/AnnotationNode.java  |  225 ++
 .../tajo/org/objectweb/asm/tree/ClassNode.java  |  345 +++
 .../org/objectweb/asm/tree/FieldInsnNode.java   |  108 +
 .../tajo/org/objectweb/asm/tree/FieldNode.java  |  243 ++
 .../tajo/org/objectweb/asm/tree/FrameNode.java  |  210 ++
 .../org/objectweb/asm/tree/IincInsnNode.java    |   82 +
 .../org/objectweb/asm/tree/InnerClassNode.java  |  101 +
 .../tajo/org/objectweb/asm/tree/InsnList.java   |  600 ++++
 .../tajo/org/objectweb/asm/tree/InsnNode.java   |   87 +
 .../org/objectweb/asm/tree/IntInsnNode.java     |   87 +
 .../asm/tree/InvokeDynamicInsnNode.java         |  100 +
 .../org/objectweb/asm/tree/JumpInsnNode.java    |   95 +
 .../tajo/org/objectweb/asm/tree/LabelNode.java  |   78 +
 .../org/objectweb/asm/tree/LdcInsnNode.java     |   78 +
 .../org/objectweb/asm/tree/LineNumberNode.java  |   84 +
 .../objectweb/asm/tree/LocalVariableNode.java   |  112 +
 .../asm/tree/LookupSwitchInsnNode.java          |  117 +
 .../org/objectweb/asm/tree/MethodInsnNode.java  |  109 +
 .../tajo/org/objectweb/asm/tree/MethodNode.java |  597 ++++
 .../asm/tree/MultiANewArrayInsnNode.java        |   83 +
 .../objectweb/asm/tree/TableSwitchInsnNode.java |  113 +
 .../objectweb/asm/tree/TryCatchBlockNode.java   |   94 +
 .../org/objectweb/asm/tree/TypeInsnNode.java    |   90 +
 .../org/objectweb/asm/tree/VarInsnNode.java     |   93 +
 .../objectweb/asm/tree/analysis/Analyzer.java   |  549 ++++
 .../asm/tree/analysis/AnalyzerException.java    |   61 +
 .../asm/tree/analysis/BasicInterpreter.java     |  358 +++
 .../objectweb/asm/tree/analysis/BasicValue.java |  111 +
 .../asm/tree/analysis/BasicVerifier.java        |  433 +++
 .../org/objectweb/asm/tree/analysis/Frame.java  |  729 +++++
 .../asm/tree/analysis/Interpreter.java          |  226 ++
 .../asm/tree/analysis/SimpleVerifier.java       |  320 +++
 .../objectweb/asm/tree/analysis/SmallSet.java   |  134 +
 .../asm/tree/analysis/SourceInterpreter.java    |  198 ++
 .../asm/tree/analysis/SourceValue.java          |   97 +
 .../objectweb/asm/tree/analysis/Subroutine.java |   90 +
 .../org/objectweb/asm/tree/analysis/Value.java  |   45 +
 .../objectweb/asm/tree/analysis/package.html    |   85 +
 .../tajo/org/objectweb/asm/tree/package.html    |  210 ++
 .../tajo/org/objectweb/asm/util/ASMifiable.java |   56 +
 .../tajo/org/objectweb/asm/util/ASMifier.java   | 1151 ++++++++
 .../asm/util/CheckAnnotationAdapter.java        |  136 +
 .../objectweb/asm/util/CheckClassAdapter.java   |  914 ++++++
 .../objectweb/asm/util/CheckFieldAdapter.java   |  100 +
 .../objectweb/asm/util/CheckMethodAdapter.java  | 1397 +++++++++
 .../asm/util/CheckSignatureAdapter.java         |  330 +++
 .../tajo/org/objectweb/asm/util/Printer.java    |  500 ++++
 .../org/objectweb/asm/util/Textifiable.java     |   56 +
 .../tajo/org/objectweb/asm/util/Textifier.java  | 1200 ++++++++
 .../asm/util/TraceAnnotationVisitor.java        |   89 +
 .../objectweb/asm/util/TraceClassVisitor.java   |  209 ++
 .../objectweb/asm/util/TraceFieldVisitor.java   |   76 +
 .../objectweb/asm/util/TraceMethodVisitor.java  |  223 ++
 .../asm/util/TraceSignatureVisitor.java         |  317 +++
 .../tajo/org/objectweb/asm/util/package.html    |   58 +
 .../objectweb/asm/xml/ASMContentHandler.java    | 1317 +++++++++
 .../tajo/org/objectweb/asm/xml/Processor.java   | 1044 +++++++
 .../tajo/org/objectweb/asm/xml/SAXAdapter.java  |   89 +
 .../objectweb/asm/xml/SAXAnnotationAdapter.java |  185 ++
 .../org/objectweb/asm/xml/SAXClassAdapter.java  |  324 +++
 .../org/objectweb/asm/xml/SAXCodeAdapter.java   |  362 +++
 .../org/objectweb/asm/xml/SAXFieldAdapter.java  |   63 +
 .../tajo/org/objectweb/asm/xml/asm-xml.dtd      |  367 +++
 .../tajo/org/objectweb/asm/xml/package.html     |  114 +
 tajo-yarn-pullserver/pom.xml                    |   17 +
 .../pullserver/FadvisedFileRegionWrapper.java   |   35 -
 .../pullserver/listener/FileCloseListener.java  |   40 -
 .../pullserver/FadvisedFileRegionWrapper.java   |   34 -
 .../pullserver/listener/FileCloseListener.java  |   42 -
 .../pullserver/FadvisedFileRegionWrapper.java   |   36 -
 .../pullserver/listener/FileCloseListener.java  |   42 -
 .../tajo/pullserver/FadvisedChunkedFile.java    |   81 +
 .../tajo/pullserver/FadvisedFileRegion.java     |  170 ++
 .../tajo/pullserver/FileCloseListener.java      |   53 +
 .../tajo/pullserver/PullServerAuxService.java   |   12 +-
 .../apache/tajo/pullserver/PullServerUtil.java  |   90 +
 .../apache/tajo/pullserver/TajoPullServer.java  |   73 +
 .../tajo/pullserver/TajoPullServerService.java  |  276 +-
 .../tajo/pullserver/retriever/FileChunk.java    |   38 +-
 .../java/org/apache/tajo/storage/Tuple.java     |   27 +-
 607 files changed, 66833 insertions(+), 5207 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-common/src/main/java/org/apache/tajo/conf/TajoConf.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
----------------------------------------------------------------------
diff --cc tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
index 9438d34,96758d6..d6dc1c2
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanPreprocessor.java
@@@ -431,19 -440,7 +440,23 @@@ public class LogicalPlanPreprocessor ex
    }
  
    @Override
-   public LogicalNode visitCreateIndex(PreprocessContext ctx, Stack<Expr> stack, CreateIndex
expr)
++//<<<<<<< HEAD
++  public LogicalNode visitCreateIndex(LogicalPlanner.PlanContext ctx, Stack<Expr>
stack, CreateIndex expr)
 +      throws PlanningException {
 +    stack.push(expr);
 +    LogicalNode child = visit(ctx, stack, expr.getChild());
 +    stack.pop();
 +
 +    CreateIndexNode createIndex = ctx.plan.createNode(CreateIndexNode.class);
 +    createIndex.setInSchema(child.getOutSchema());
 +    createIndex.setOutSchema(child.getOutSchema());
 +    return createIndex;
 +  }
 +
-   public LogicalNode visitTruncateTable(PreprocessContext ctx, Stack<Expr> stack,
TruncateTable expr)
++//  public LogicalNode visitTruncateTable(PreprocessContext ctx, Stack<Expr> stack,
TruncateTable expr)
++//=======
+   public LogicalNode visitTruncateTable(LogicalPlanner.PlanContext ctx, Stack<Expr>
stack, TruncateTable expr)
++//>>>>>>> 644b7cd991ea402115c6dc1d198e7f1d7f41771b
        throws PlanningException {
      TruncateTableNode truncateTableNode = ctx.plan.createNode(TruncateTableNode.class);
      return truncateTableNode;

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
----------------------------------------------------------------------
diff --cc tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
index 58477b7,89382f4..e38e47d
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
@@@ -790,23 -821,26 +822,31 @@@ public class LogicalPlanner extends Bas
  
  
      // Building sort keys
-     sortNode.setSortSpecs(annotateSortSpecs(block, referNames, sortSpecs));
-     return sortNode;
++    SortSpec[] annotatedSortSpecs = annotateSortSpecs(block, referNames, sortSpecs);
++    if (annotatedSortSpecs.length == 0) {
++      return child;
++    } else {
++      sortNode.setSortSpecs(annotatedSortSpecs);
++      return sortNode;
++    }
 +  }
 +
 +  private static SortSpec[] annotateSortSpecs(QueryBlock block, String [] referNames, Sort.SortSpec[]
rawSortSpecs) {
 +    int sortKeyNum = rawSortSpecs.length;
      Column column;
-     SortSpec [] annotatedSortSpecs = new SortSpec[sortKeyNum];
+     List<SortSpec> annotatedSortSpecs = Lists.newArrayList();
      for (int i = 0; i < sortKeyNum; i++) {
-       if (block.namedExprsMgr.isEvaluated(referNames[i])) {
-         column = block.namedExprsMgr.getTarget(referNames[i]).getNamedColumn();
+       String refName = referNames[i];
+       if (block.isConstReference(refName)) {
+         continue;
+       } else if (block.namedExprsMgr.isEvaluated(refName)) {
+         column = block.namedExprsMgr.getTarget(refName).getNamedColumn();
        } else {
 -        throw new IllegalStateException("Unexpected State: " + TUtil.arrayToString(sortSpecs));
 +        throw new IllegalStateException("Unexpected State: " + TUtil.arrayToString(rawSortSpecs));
        }
-       annotatedSortSpecs[i] = new SortSpec(column, rawSortSpecs[i].isAscending(), rawSortSpecs[i].isNullFirst());
 -      annotatedSortSpecs.add(new SortSpec(column, sortSpecs[i].isAscending(), sortSpecs[i].isNullFirst()));
 -    }
 -
 -    if (annotatedSortSpecs.size() == 0) {
 -      return child;
 -    } else {
 -      sortNode.setSortSpecs(annotatedSortSpecs.toArray(new SortSpec[annotatedSortSpecs.size()]));
 -      return sortNode;
++      annotatedSortSpecs.add(new SortSpec(column, rawSortSpecs[i].isAscending(), rawSortSpecs[i].isNullFirst()));
      }
-     return annotatedSortSpecs;
++    return annotatedSortSpecs.toArray(new SortSpec[annotatedSortSpecs.size()]);
    }
  
    /*===============================================================================================
@@@ -1835,49 -1880,6 +1886,49 @@@
    }
  
    @Override
 +  public LogicalNode visitCreateIndex(PlanContext context, Stack<Expr> stack, CreateIndex
createIndex)
 +      throws PlanningException {
 +    stack.push(createIndex);
 +    LogicalNode child = visit(context, stack, createIndex.getChild());
 +    stack.pop();
 +
 +    QueryBlock block = context.queryBlock;
 +    CreateIndexNode createIndexNode = block.getNodeFromExpr(createIndex);
 +    if (CatalogUtil.isFQTableName(createIndex.getIndexName())) {
 +      createIndexNode.setIndexName(createIndex.getIndexName());
 +    } else {
 +      createIndexNode.setIndexName(
-           CatalogUtil.buildFQName(context.session.getCurrentDatabase(), createIndex.getIndexName()));
++          CatalogUtil.buildFQName(context.queryContext.getCurrentDatabase(), createIndex.getIndexName()));
 +    }
 +    createIndexNode.setUnique(createIndex.isUnique());
 +    Sort.SortSpec[] sortSpecs = createIndex.getSortSpecs();
 +    int sortKeyNum = sortSpecs.length;
 +    String[] referNames = new String[sortKeyNum];
 +
 +    ExprNormalizedResult[] normalizedExprList = new ExprNormalizedResult[sortKeyNum];
 +    for (int i = 0; i < sortKeyNum; i++) {
 +      normalizedExprList[i] = normalizer.normalize(context, sortSpecs[i].getKey());
 +    }
 +    for (int i = 0; i < sortKeyNum; i++) {
 +      referNames[i] = block.namedExprsMgr.addExpr(normalizedExprList[i].baseExpr);
 +      block.namedExprsMgr.addNamedExprArray(normalizedExprList[i].aggExprs);
 +      block.namedExprsMgr.addNamedExprArray(normalizedExprList[i].scalarExprs);
 +    }
 +
 +    createIndexNode.setSortSpecs(annotateSortSpecs(block, referNames, sortSpecs));
 +    createIndexNode.setIndexType(IndexMethod.valueOf(createIndex.getMethodSpec().getName().toUpperCase()));
 +
 +    if (createIndex.getParams() != null) {
 +      KeyValueSet keyValueSet = new KeyValueSet();
 +      keyValueSet.putAll(createIndex.getParams());
 +      createIndexNode.setOptions(keyValueSet);
 +    }
 +
 +    createIndexNode.setChild(child);
 +    return createIndexNode;
 +  }
 +
 +  @Override
    public LogicalNode visitTruncateTable(PlanContext context, Stack<Expr> stack, TruncateTable
truncateTable)
        throws PlanningException {
      TruncateTableNode truncateTableNode = context.queryBlock.getNodeFromExpr(truncateTable);

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/main/java/org/apache/tajo/engine/planner/rewrite/ProjectionPushDownRule.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/main/java/org/apache/tajo/worker/TaskAttemptContext.java
----------------------------------------------------------------------

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

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
----------------------------------------------------------------------
diff --cc tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
index 2ca85cc,73f72be..a53c3a8
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
@@@ -836,31 -871,11 +871,34 @@@ public class TestLogicalPlanner 
    }
  
    @Test
 +  public final void testCreateIndexNode() throws PlanningException {
++    QueryContext qc = new QueryContext(util.getConfiguration(), session);
 +    Expr expr = sqlAnalyzer.parse(QUERIES[11]);
-     LogicalPlan rootNode = planner.createPlan(session, expr);
++    LogicalPlan rootNode = planner.createPlan(qc, expr);
 +    LogicalNode plan = rootNode.getRootBlock().getRoot();
 +    testJsonSerDerObject(plan);
 +
 +    LogicalRootNode root = (LogicalRootNode) plan;
 +    assertEquals(NodeType.CREATE_INDEX, root.getChild().getType());
 +    CreateIndexNode createIndexNode = root.getChild();
 +
 +    assertEquals(NodeType.PROJECTION, createIndexNode.getChild().getType());
 +    ProjectionNode projNode = createIndexNode.getChild();
 +
 +    assertEquals(NodeType.SELECTION, projNode.getChild().getType());
 +    SelectionNode selNode = projNode.getChild();
 +
 +    assertEquals(NodeType.SCAN, selNode.getChild().getType());
 +    ScanNode scanNode = selNode.getChild();
 +    assertEquals(CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "employee"), scanNode.getTableName());
 +  }
 +
 +  @Test
    public final void testAsterisk() throws CloneNotSupportedException, PlanningException
{
+     QueryContext qc = new QueryContext(util.getConfiguration(), session);
+ 
      Expr expr = sqlAnalyzer.parse(QUERIES[13]);
-     LogicalPlan planNode = planner.createPlan(session, expr);
+     LogicalPlan planNode = planner.createPlan(qc, expr);
      LogicalNode plan = planNode.getRootBlock().getRoot();
      assertEquals(NodeType.ROOT, plan.getType());
      TestLogicalNode.testCloneLogicalNode(plan);

http://git-wip-us.apache.org/repos/asf/tajo/blob/bf5b43c4/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 920c932,5d809f8..8e6dce3
--- 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
@@@ -798,17 -983,11 +983,21 @@@ public class TestPhysicalPlanner 
      FileFragment[] frags = StorageManager.splitNG(conf, "default.employee", employee.getMeta(),
employee.getPath(),
          Integer.MAX_VALUE);
      Path workDir = CommonTestingUtil.getTestDir("target/test-data/testCreateIndex");
++//<<<<<<< HEAD
 +    Path indexPath = StorageUtil.concatPath(conf.getVar(ConfVars.ROOT_DIR), "default/idx_employee");
 +    if (sm.getFileSystem().exists(indexPath)) {
 +      sm.getFileSystem().delete(indexPath, true);
 +    }
 +
-     TaskAttemptContext ctx = new TaskAttemptContext(conf, new QueryContext(),
+     TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf),
++//=======
++//    TaskAttemptContext ctx = new TaskAttemptContext(new QueryContext(conf),
++//>>>>>>> 644b7cd991ea402115c6dc1d198e7f1d7f41771b
          LocalTajoTestingUtility.newQueryUnitAttemptId(masterPlan),
          new FileFragment[] {frags[0]}, workDir);
 +    ctx.setEnforcer(new Enforcer());
      Expr context = analyzer.parse(createIndexStmt[0]);
-     LogicalPlan plan = planner.createPlan(session, context);
+     LogicalPlan plan = planner.createPlan(defaultContext, context);
      LogicalNode rootNode = optimizer.optimize(plan);
  
      PhysicalPlanner phyPlanner = new PhysicalPlannerImpl(conf, sm);


Mime
View raw message