drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [10/13] drill git commit: DRILL-1384: Part 1 - Rebase on Calcite. Change code due to Calcite package renaming/re-structure.
Date Wed, 22 Apr 2015 06:10:13 GMT
DRILL-1384: Part 1 - Rebase on Calcite. Change code due to Calcite package renaming/re-structure.

Optiq changed to use DATETIME_PLUS. Have to handle it in Drill.

PushFilterPastJoinRule has some issue. Temp fix for that.

Failed unit tests:
       1) TestFlatten
       2) TestConvertFunctions / TestComplexTypeWriter : "Concat"
       3) TPCH Q16 : CanNotPlanException

Feed a RelDataTypeSystem into planner, to support decimal with precision/scale up to 38.

Remove assertion in DrillFilterRel. Optiq/Calcite could create a TRUE AND TRUE for query like WHERE col1 in (select ...) and col2 in (select ...) .

Rebase on calcite-1.1.0-drill-test-r1. Change code due to Calcite package renaming/re-structure.

Rebase on calcite : remaing with perl script. Part 1

reverse change to jdbc test.

Renaming for rebasing calcite. Part 2

Renaming for calcite rebasing. Part 3

Renaming for calcite rebasing. Part 4

Reverse change to testcase in jdbc.

Renaming for calcite rebasing. Part 5

Renaming for calcite rebasing. Part 6

remove 1.sh

WindowRel change related.

Renaming for calcite rebase. Part 7

PreprocessLogical and AggPrelBase

Renaming for calcite rebasing. Part 8. More manual change

Rebasing Calcite. Part 9

Rebasing calcite. Part 10

Rebasing API change from Calcite.

SQL parser change, due to Calcite rebasing.

Renaming change for calcite rebasing.

Renaming package due to Calcite rebasing.

Renaming package due to Calicte Rebase.

Work in progress for calcite rebasing.

Change import package names due to Calcite rebase.

Code refactor due to Calcite rebasing.

Fix bug in DistributionTraitDef.

Resolve compiler error, due to Calcite Rebasing.

Resolve compiler error after Calcite Rebasing.

minor change.


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

Branch: refs/heads/master
Commit: 581f2e840336f78bd8e6e1a7fca34fdd8f10b7fc
Parents: 2a48425
Author: Jinfeng Ni <jni@maprtech.com>
Authored: Wed Oct 1 10:09:42 2014 -0700
Committer: Jinfeng Ni <jni@apache.org>
Committed: Tue Apr 21 16:29:37 2015 -0700

----------------------------------------------------------------------
 .../apache/drill/common/logical/data/Join.java  |   2 +-
 .../apache/drill/common/logical/data/Order.java |   6 +-
 .../drill/common/logical/data/OrderTest.java    |   6 +-
 .../drill/exec/store/hbase/DrillHBaseTable.java |   6 +-
 .../store/hbase/HBasePushFilterIntoScan.java    |   6 +-
 .../exec/store/hbase/HBaseSchemaFactory.java    |   6 +-
 .../exec/store/hbase/HBaseStoragePlugin.java    |   2 +-
 .../drill/exec/planner/sql/HiveUDFOperator.java |  32 +++---
 .../HivePushPartitionFilterIntoScan.java        |   4 +-
 .../drill/exec/store/hive/HiveReadEntry.java    |   2 +-
 .../exec/store/hive/HiveStoragePlugin.java      |   4 +-
 .../exec/store/hive/schema/DrillHiveTable.java  |   8 +-
 .../store/hive/schema/DrillHiveViewTable.java   |   2 +-
 .../store/hive/schema/HiveDatabaseSchema.java   |   2 +-
 .../store/hive/schema/HiveSchemaFactory.java    |   6 +-
 .../store/mongo/MongoPushDownFilterForScan.java |   6 +-
 .../exec/store/mongo/MongoStoragePlugin.java    |   2 +-
 .../store/mongo/schema/MongoDatabaseSchema.java |   2 +-
 .../store/mongo/schema/MongoSchemaFactory.java  |   4 +-
 exec/java-exec/pom.xml                          |   4 +-
 exec/java-exec/src/main/codegen/data/Parser.tdd |   2 +-
 .../org/apache/drill/exec/dotdrill/View.java    |  28 ++---
 .../exec/expr/fn/DrillFunctionRegistry.java     |   2 +-
 .../exec/expr/fn/FunctionGenerationHelper.java  |   2 +-
 .../apache/drill/exec/ops/FragmentContext.java  |   3 +-
 .../org/apache/drill/exec/ops/QueryContext.java |   4 +-
 .../apache/drill/exec/opt/BasicOptimizer.java   |   5 +-
 .../drill/exec/physical/config/HashJoinPOP.java |   2 +-
 .../exec/physical/config/MergeJoinPOP.java      |   2 +-
 .../exec/physical/config/NestedLoopJoinPOP.java |   2 +-
 .../exec/physical/impl/TopN/TopNBatch.java      |   4 +-
 .../exec/physical/impl/join/HashJoinBatch.java  |   2 +-
 .../exec/physical/impl/join/HashJoinProbe.java  |   2 +-
 .../impl/join/HashJoinProbeTemplate.java        |   2 +-
 .../exec/physical/impl/join/JoinStatus.java     |   2 +-
 .../exec/physical/impl/join/JoinTemplate.java   |   2 +-
 .../exec/physical/impl/join/JoinUtils.java      |  15 ++-
 .../exec/physical/impl/join/MergeJoinBatch.java |   2 +-
 .../physical/impl/join/MergeJoinCreator.java    |   2 +-
 .../impl/mergereceiver/MergingRecordBatch.java  |   3 +-
 .../OrderedPartitionRecordBatch.java            |   4 +-
 .../exec/physical/impl/sort/SortBatch.java      |   4 +-
 .../physical/impl/xsort/ExternalSortBatch.java  |   2 +-
 .../drill/exec/planner/StarColumnHelper.java    |   6 +-
 .../planner/common/DrillAggregateRelBase.java   |  25 ++--
 .../exec/planner/common/DrillFilterRelBase.java |  35 +++---
 .../exec/planner/common/DrillJoinRelBase.java   |  22 ++--
 .../exec/planner/common/DrillLimitRelBase.java  |  18 +--
 .../planner/common/DrillProjectRelBase.java     |  26 ++---
 .../drill/exec/planner/common/DrillRelNode.java |   2 +-
 .../exec/planner/common/DrillRelOptUtil.java    |  21 ++--
 .../exec/planner/common/DrillScanRelBase.java   |  12 +-
 .../exec/planner/common/DrillScreenRelBase.java |  16 +--
 .../exec/planner/common/DrillStoreRelBase.java  |  14 +--
 .../exec/planner/common/DrillUnionRelBase.java  |  14 +--
 .../exec/planner/common/DrillWindowRelBase.java |  16 +--
 .../exec/planner/common/DrillWriterRelBase.java |  14 +--
 .../drill/exec/planner/cost/DrillCostBase.java  |   6 +-
 .../exec/planner/cost/DrillRelOptCost.java      |   3 +-
 .../planner/cost/DrillRelOptCostFactory.java    |   4 +-
 .../exec/planner/logical/DirPathBuilder.java    |  34 +++---
 .../exec/planner/logical/DrillAggregateRel.java |  32 +++---
 .../planner/logical/DrillAggregateRule.java     |  29 ++---
 .../exec/planner/logical/DrillConditions.java   |   6 +-
 .../planner/logical/DrillConstExecutor.java     |  30 +++--
 .../exec/planner/logical/DrillFilterRel.java    |  20 ++--
 .../exec/planner/logical/DrillFilterRule.java   |  20 ++--
 .../exec/planner/logical/DrillImplementor.java  |   3 +-
 .../exec/planner/logical/DrillJoinRel.java      |  30 ++---
 .../exec/planner/logical/DrillJoinRule.java     |  38 +++----
 .../exec/planner/logical/DrillLimitRel.java     |  16 +--
 .../exec/planner/logical/DrillLimitRule.java    |  23 ++--
 .../planner/logical/DrillMergeFilterRule.java   |  62 +++++-----
 .../planner/logical/DrillMergeProjectRule.java  |  20 ++--
 .../drill/exec/planner/logical/DrillOptiq.java  |  75 ++++++------
 .../exec/planner/logical/DrillProjectRel.java   |  25 ++--
 .../exec/planner/logical/DrillProjectRule.java  |  21 ++--
 .../logical/DrillPushFilterPastProjectRule.java |  48 ++++----
 .../DrillPushPartitionFilterIntoScan.java       |   7 +-
 .../planner/logical/DrillPushProjIntoScan.java  |  27 ++---
 .../logical/DrillPushProjectPastFilterRule.java |   8 +-
 .../logical/DrillPushProjectPastJoinRule.java   |   8 +-
 .../logical/DrillReduceAggregatesRule.java      | 114 ++++++++++---------
 .../logical/DrillReduceExpressionsRule.java     |  24 ++--
 .../drill/exec/planner/logical/DrillRel.java    |   2 +-
 .../exec/planner/logical/DrillRuleSets.java     |  47 ++++----
 .../exec/planner/logical/DrillScanRel.java      |  14 +--
 .../exec/planner/logical/DrillScanRule.java     |  12 +-
 .../exec/planner/logical/DrillScreenRel.java    |   8 +-
 .../exec/planner/logical/DrillSortRel.java      |  24 ++--
 .../exec/planner/logical/DrillSortRule.java     |  22 ++--
 .../exec/planner/logical/DrillStoreRel.java     |  10 +-
 .../drill/exec/planner/logical/DrillTable.java  |  13 +--
 .../exec/planner/logical/DrillUnionRel.java     |  14 +--
 .../exec/planner/logical/DrillUnionRule.java    |  24 ++--
 .../exec/planner/logical/DrillValuesRel.java    |  46 ++++----
 .../exec/planner/logical/DrillValuesRule.java   |  16 +--
 .../exec/planner/logical/DrillViewTable.java    |  24 ++--
 .../exec/planner/logical/DrillWindowRel.java    |  37 +++---
 .../exec/planner/logical/DrillWindowRule.java   |  20 ++--
 .../exec/planner/logical/DrillWriterRel.java    |   8 +-
 .../exec/planner/logical/DynamicDrillTable.java |   4 +-
 .../planner/logical/EnumerableDrillRule.java    |   6 +-
 .../planner/logical/PartitionPruningUtil.java   |   4 +-
 .../planner/logical/PreProcessLogicalRel.java   |  48 ++++----
 .../exec/planner/logical/RelOptHelper.java      |   8 +-
 .../partition/FindPartitionConditions.java      |  35 +++---
 .../logical/partition/PruneScanRule.java        |  17 ++-
 .../exec/planner/physical/AggPrelBase.java      |  52 +++++----
 .../exec/planner/physical/AggPruleBase.java     |  10 +-
 .../planner/physical/BroadcastExchangePrel.java |  16 +--
 .../planner/physical/ComplexToJsonPrel.java     |  10 +-
 .../physical/ConvertCountToDirectScan.java      |  26 ++---
 .../physical/DrillDistributionTrait.java        |   9 +-
 .../physical/DrillDistributionTraitDef.java     |  26 +++--
 .../exec/planner/physical/ExchangePrel.java     |   6 +-
 .../drill/exec/planner/physical/FilterPrel.java |  16 +--
 .../exec/planner/physical/FilterPrule.java      |  10 +-
 .../exec/planner/physical/FlattenPrel.java      |  16 +--
 .../exec/planner/physical/HashAggPrel.java      |  40 ++++---
 .../exec/planner/physical/HashAggPrule.java     |  47 +++++---
 .../exec/planner/physical/HashJoinPrel.java     |  27 ++---
 .../exec/planner/physical/HashJoinPrule.java    |  14 +--
 .../physical/HashToMergeExchangePrel.java       |  22 ++--
 .../physical/HashToRandomExchangePrel.java      |  22 ++--
 .../drill/exec/planner/physical/JoinPrel.java   |  26 ++---
 .../exec/planner/physical/JoinPruleBase.java    |  22 ++--
 .../drill/exec/planner/physical/LimitPrel.java  |  16 +--
 .../drill/exec/planner/physical/LimitPrule.java |  10 +-
 .../exec/planner/physical/MergeJoinPrel.java    |  26 ++---
 .../exec/planner/physical/MergeJoinPrule.java   |  20 ++--
 .../physical/OrderedPartitionExchangePrel.java  |  14 +--
 .../exec/planner/physical/PlannerSettings.java  |   2 +-
 .../drill/exec/planner/physical/Prel.java       |   2 +-
 .../drill/exec/planner/physical/PrelUtil.java   |  41 ++++---
 .../planner/physical/ProducerConsumerPrel.java  |  10 +-
 .../planner/physical/ProjectAllowDupPrel.java   |  17 ++-
 .../exec/planner/physical/ProjectPrel.java      |  21 ++--
 .../exec/planner/physical/ProjectPrule.java     |  30 ++---
 .../drill/exec/planner/physical/Prule.java      |  11 +-
 .../exec/planner/physical/PushLimitToTopN.java  |   8 +-
 .../drill/exec/planner/physical/ScanPrel.java   |  16 +--
 .../drill/exec/planner/physical/ScanPrule.java  |   6 +-
 .../drill/exec/planner/physical/ScreenPrel.java |  10 +-
 .../exec/planner/physical/ScreenPrule.java      |   8 +-
 .../physical/SelectionVectorRemoverPrel.java    |   8 +-
 .../physical/SingleMergeExchangePrel.java       |  26 ++---
 .../drill/exec/planner/physical/SinglePrel.java |  10 +-
 .../exec/planner/physical/SortConvertPrule.java |  26 ++---
 .../drill/exec/planner/physical/SortPrel.java   |  30 +++--
 .../drill/exec/planner/physical/SortPrule.java  |  12 +-
 .../exec/planner/physical/StreamAggPrel.java    |  43 +++----
 .../exec/planner/physical/StreamAggPrule.java   |  63 +++++++---
 .../planner/physical/SubsetTransformer.java     |  14 +--
 .../drill/exec/planner/physical/TopNPrel.java   |  22 ++--
 .../exec/planner/physical/UnionAllPrel.java     |  19 ++--
 .../exec/planner/physical/UnionAllPrule.java    |  14 +--
 .../planner/physical/UnionDistinctPrel.java     |  18 +--
 .../planner/physical/UnionDistinctPrule.java    |  14 +--
 .../planner/physical/UnionExchangePrel.java     |  16 +--
 .../drill/exec/planner/physical/UnionPrel.java  |   8 +-
 .../physical/UnorderedDeMuxExchangePrel.java    |  10 +-
 .../physical/UnorderedMuxExchangePrel.java      |   8 +-
 .../drill/exec/planner/physical/ValuesPrel.java |   8 +-
 .../exec/planner/physical/ValuesPrule.java      |   5 +-
 .../drill/exec/planner/physical/WindowPrel.java |  33 +++---
 .../exec/planner/physical/WindowPrule.java      |  53 ++++-----
 .../drill/exec/planner/physical/WriterPrel.java |  10 +-
 .../exec/planner/physical/WriterPrule.java      |   8 +-
 .../physical/explain/NumberingRelWriter.java    |  19 ++--
 .../planner/physical/explain/PrelSequencer.java |   4 +-
 .../visitor/ComplexToJsonPrelVisitor.java       |   4 +-
 .../visitor/ExcessiveExchangeIdentifier.java    |   6 +-
 .../physical/visitor/FinalColumnReorderer.java  |  12 +-
 .../visitor/InsertLocalExchangeVisitor.java     |  14 +--
 .../physical/visitor/JoinPrelRenameVisitor.java |   2 +-
 .../visitor/MemoryEstimationVisitor.java        |   2 +-
 .../visitor/ProducerConsumerPrelVisitor.java    |   2 +-
 .../planner/physical/visitor/RelUniqifier.java  |   2 +-
 .../visitor/RewriteProjectToFlatten.java        |  29 ++---
 .../visitor/RexVisitorComplexExprSplitter.java  |  26 ++---
 .../visitor/SelectionVectorPrelVisitor.java     |   2 +-
 .../visitor/SplitUpComplexExpressions.java      |  32 ++----
 .../physical/visitor/StarColumnConverter.java   |  26 ++---
 .../physical/visitor/SwapHashJoinVisitor.java   |   6 +-
 .../apache/drill/exec/planner/sql/Checker.java  |   8 +-
 .../exec/planner/sql/DrillConvertletTable.java  |  12 +-
 .../planner/sql/DrillExtractConvertlet.java     |  18 +--
 .../exec/planner/sql/DrillOperatorTable.java    |  12 +-
 .../exec/planner/sql/DrillSqlAggOperator.java   |  40 +++----
 .../exec/planner/sql/DrillSqlOperator.java      |  22 ++--
 .../drill/exec/planner/sql/DrillSqlWorker.java  |  53 +++++----
 .../exec/planner/sql/DynamicReturnType.java     |   2 +-
 .../drill/exec/planner/sql/DynamicType.java     |   8 +-
 .../drill/exec/planner/sql/FixedRange.java      |   2 +-
 .../sql/handlers/AbstractSqlHandler.java        |   8 +-
 .../sql/handlers/CreateTableHandler.java        |  14 ++-
 .../planner/sql/handlers/DefaultSqlHandler.java |  20 ++--
 .../sql/handlers/DescribeTableHandler.java      |  24 ++--
 .../planner/sql/handlers/ExplainHandler.java    |  16 +--
 .../planner/sql/handlers/SetOptionHandler.java  |  10 +-
 .../planner/sql/handlers/ShowFileHandler.java   |  10 +-
 .../sql/handlers/ShowSchemasHandler.java        |  14 +--
 .../planner/sql/handlers/ShowTablesHandler.java |  18 +--
 .../planner/sql/handlers/SqlHandlerConfig.java  |   4 +-
 .../planner/sql/handlers/SqlHandlerUtil.java    |  21 ++--
 .../planner/sql/handlers/UseSchemaHandler.java  |   6 +-
 .../exec/planner/sql/handlers/ViewHandler.java  |  20 ++--
 .../sql/parser/CompoundIdentifierConverter.java |  16 +--
 .../sql/parser/DrillCompoundIdentifier.java     |  12 +-
 .../planner/sql/parser/DrillParserUtil.java     |   8 +-
 .../exec/planner/sql/parser/DrillSqlCall.java   |  10 +-
 .../exec/planner/sql/parser/SqlCreateTable.java |  26 ++---
 .../exec/planner/sql/parser/SqlCreateView.java  |  20 ++--
 .../planner/sql/parser/SqlDescribeTable.java    |  22 ++--
 .../exec/planner/sql/parser/SqlDropView.java    |  22 ++--
 .../exec/planner/sql/parser/SqlShowFiles.java   |  22 ++--
 .../exec/planner/sql/parser/SqlShowSchemas.java |  20 ++--
 .../exec/planner/sql/parser/SqlShowTables.java  |  18 +--
 .../exec/planner/sql/parser/SqlUseSchema.java   |  18 +--
 .../sql/parser/UnsupportedOperatorsVisitor.java |  18 +--
 .../DrillParserWithCompoundIdConverter.java     |  10 +-
 .../exec/planner/torel/ConversionContext.java   |  23 ++--
 .../types/DrillFixedRelDataTypeImpl.java        |  36 +++---
 .../planner/types/DrillRelDataTypeSystem.java   |  39 +++++++
 .../planner/types/RelDataTypeDrillImpl.java     |  16 +--
 .../exec/planner/types/RelDataTypeHolder.java   |   8 +-
 .../apache/drill/exec/rpc/user/UserSession.java |   4 +-
 .../server/options/FallbackOptionManager.java   |   2 +-
 .../exec/server/options/OptionManager.java      |  17 +--
 .../exec/server/options/OptionValidator.java    |   5 +-
 .../server/options/SystemOptionManager.java     |   2 +-
 .../exec/server/options/TypeValidators.java     |   7 +-
 .../apache/drill/exec/store/AbstractSchema.java |  12 +-
 .../drill/exec/store/PartitionExplorerImpl.java |   2 +-
 .../apache/drill/exec/store/RecordDataType.java |  12 +-
 .../apache/drill/exec/store/SchemaFactory.java  |   2 +-
 .../exec/store/StoragePluginOptimizerRule.java  |   4 +-
 .../drill/exec/store/StoragePluginRegistry.java |   6 +-
 .../drill/exec/store/SubSchemaWrapper.java      |   5 +-
 .../drill/exec/store/dfs/FileSystemPlugin.java  |   2 +-
 .../exec/store/dfs/FileSystemSchemaFactory.java |   7 +-
 .../exec/store/dfs/WorkspaceSchemaFactory.java  |   2 +-
 .../store/ischema/InfoSchemaDrillTable.java     |   4 +-
 ...InfoSchemaPushFilterIntoRecordGenerator.java |   8 +-
 .../store/ischema/InfoSchemaStoragePlugin.java  |   4 +-
 .../exec/store/ischema/InfoSchemaTable.java     |   6 +-
 .../exec/store/ischema/RecordGenerator.java     |  12 +-
 .../drill/exec/store/ischema/Records.java       |   6 +-
 .../drill/exec/store/ischema/SelectedTable.java |   6 +-
 .../exec/store/mock/MockStorageEngine.java      |   2 +-
 .../drill/exec/store/pojo/PojoDataType.java     |   6 +-
 .../drill/exec/store/sys/StaticDrillTable.java  |   5 +-
 .../drill/exec/store/sys/SystemTable.java       |   4 +
 .../drill/exec/store/sys/SystemTablePlugin.java |   2 +-
 .../foreman/UnsupportedDataTypeException.java   |   2 +-
 .../java/org/apache/drill/PlanTestBase.java     |   4 +-
 .../java/org/apache/drill/PlanningBase.java     |   4 +-
 .../exec/planner/logical/FilterSplitTest.java   |  14 +--
 .../exec/sql/TestSqlBracketlessSyntax.java      |  23 ++--
 .../org/apache/drill/jdbc/test/JdbcAssert.java  |   2 +-
 .../apache/drill/jdbc/test/JdbcDataTest.java    |   2 +-
 262 files changed, 2017 insertions(+), 1914 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/common/src/main/java/org/apache/drill/common/logical/data/Join.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/logical/data/Join.java b/common/src/main/java/org/apache/drill/common/logical/data/Join.java
index a3d44f5..2d7e6e1 100644
--- a/common/src/main/java/org/apache/drill/common/logical/data/Join.java
+++ b/common/src/main/java/org/apache/drill/common/logical/data/Join.java
@@ -23,7 +23,7 @@ import java.util.List;
 import org.apache.drill.common.exceptions.ExpressionParsingException;
 import org.apache.drill.common.expression.LogicalExpression;
 import org.apache.drill.common.logical.data.visitors.LogicalVisitor;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/common/src/main/java/org/apache/drill/common/logical/data/Order.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/logical/data/Order.java b/common/src/main/java/org/apache/drill/common/logical/data/Order.java
index ee6f9a9..fca6010 100644
--- a/common/src/main/java/org/apache/drill/common/logical/data/Order.java
+++ b/common/src/main/java/org/apache/drill/common/logical/data/Order.java
@@ -24,9 +24,9 @@ import org.apache.drill.common.exceptions.DrillRuntimeException;
 import org.apache.drill.common.expression.FieldReference;
 import org.apache.drill.common.expression.LogicalExpression;
 import org.apache.drill.common.logical.data.visitors.LogicalVisitor;
-import org.eigenbase.rel.RelFieldCollation;
-import org.eigenbase.rel.RelFieldCollation.Direction;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.calcite.rel.RelFieldCollation;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java b/common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java
index 144b35b..80b4e3c 100644
--- a/common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java
+++ b/common/src/test/java/org/apache/drill/common/logical/data/OrderTest.java
@@ -24,9 +24,9 @@ import java.sql.SQLException;
 import org.apache.drill.common.exceptions.DrillRuntimeException;
 import org.apache.drill.common.expression.LogicalExpression;
 import org.apache.drill.common.logical.data.Order.Ordering;
-import org.eigenbase.rel.RelFieldCollation;
-import org.eigenbase.rel.RelFieldCollation.Direction;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.calcite.rel.RelFieldCollation;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.*;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/DrillHBaseTable.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/DrillHBaseTable.java b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/DrillHBaseTable.java
index ff6991f..ffa18e7 100644
--- a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/DrillHBaseTable.java
+++ b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/DrillHBaseTable.java
@@ -25,9 +25,9 @@ import org.apache.drill.exec.planner.logical.DrillTable;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.sql.type.SqlTypeName;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.sql.type.SqlTypeName;
 
 public class DrillHBaseTable extends DrillTable implements DrillHBaseConstants {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillHBaseTable.class);

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBasePushFilterIntoScan.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBasePushFilterIntoScan.java b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBasePushFilterIntoScan.java
index c395b43..f1f3a0b 100644
--- a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBasePushFilterIntoScan.java
+++ b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBasePushFilterIntoScan.java
@@ -25,9 +25,9 @@ import org.apache.drill.exec.planner.logical.RelOptHelper;
 import org.apache.drill.exec.planner.physical.FilterPrel;
 import org.apache.drill.exec.planner.physical.ScanPrel;
 import org.apache.drill.exec.store.StoragePluginOptimizerRule;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rex.RexNode;
 
 import com.google.common.collect.ImmutableList;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseSchemaFactory.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseSchemaFactory.java b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseSchemaFactory.java
index 47d08b4..866a2dc 100644
--- a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseSchemaFactory.java
+++ b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseSchemaFactory.java
@@ -21,9 +21,9 @@ import java.io.IOException;
 import java.util.Collections;
 import java.util.Set;
 
-import net.hydromatic.optiq.Schema;
-import net.hydromatic.optiq.SchemaPlus;
-import net.hydromatic.optiq.Table;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.schema.Table;
 
 import org.apache.drill.exec.store.AbstractSchema;
 import org.apache.drill.exec.store.SchemaConfig;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseStoragePlugin.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseStoragePlugin.java b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseStoragePlugin.java
index 2214c50..7737f69 100644
--- a/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseStoragePlugin.java
+++ b/contrib/storage-hbase/src/main/java/org/apache/drill/exec/store/hbase/HBaseStoragePlugin.java
@@ -20,7 +20,7 @@ package org.apache.drill.exec.store.hbase;
 import java.io.IOException;
 import java.util.Set;
 
-import net.hydromatic.optiq.SchemaPlus;
+import org.apache.calcite.schema.SchemaPlus;
 
 import org.apache.drill.common.JSONOptions;
 import org.apache.drill.exec.server.DrillbitContext;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/HiveUDFOperator.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/HiveUDFOperator.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/HiveUDFOperator.java
index 8a54bfe..988060c 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/HiveUDFOperator.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/HiveUDFOperator.java
@@ -19,22 +19,22 @@
 package org.apache.drill.exec.planner.sql;
 
 import com.fasterxml.jackson.databind.type.TypeFactory;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.sql.SqlCall;
-import org.eigenbase.sql.SqlCallBinding;
-import org.eigenbase.sql.SqlFunction;
-import org.eigenbase.sql.SqlFunctionCategory;
-import org.eigenbase.sql.SqlIdentifier;
-import org.eigenbase.sql.SqlOperandCountRange;
-import org.eigenbase.sql.SqlOperator;
-import org.eigenbase.sql.SqlOperatorBinding;
-import org.eigenbase.sql.parser.SqlParserPos;
-import org.eigenbase.sql.type.SqlOperandCountRanges;
-import org.eigenbase.sql.type.SqlOperandTypeChecker;
-import org.eigenbase.sql.type.SqlTypeName;
-import org.eigenbase.sql.validate.SqlValidator;
-import org.eigenbase.sql.validate.SqlValidatorScope;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.sql.SqlCall;
+import org.apache.calcite.sql.SqlCallBinding;
+import org.apache.calcite.sql.SqlFunction;
+import org.apache.calcite.sql.SqlFunctionCategory;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlOperandCountRange;
+import org.apache.calcite.sql.SqlOperator;
+import org.apache.calcite.sql.SqlOperatorBinding;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlOperandCountRanges;
+import org.apache.calcite.sql.type.SqlOperandTypeChecker;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.sql.validate.SqlValidator;
+import org.apache.calcite.sql.validate.SqlValidatorScope;
 
 public class HiveUDFOperator extends SqlFunction {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/logical/HivePushPartitionFilterIntoScan.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/logical/HivePushPartitionFilterIntoScan.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/logical/HivePushPartitionFilterIntoScan.java
index 9b93ac0..6ab1a78 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/logical/HivePushPartitionFilterIntoScan.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/planner/sql/logical/HivePushPartitionFilterIntoScan.java
@@ -37,8 +37,8 @@ import org.apache.drill.exec.store.hive.HiveReadEntry;
 import org.apache.drill.exec.store.hive.HiveScan;
 import org.apache.drill.exec.store.hive.HiveTable;
 import org.apache.drill.exec.store.hive.HiveTable.HivePartition;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelOptRuleOperand;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptRuleOperand;
 
 import com.google.common.collect.Lists;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveReadEntry.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveReadEntry.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveReadEntry.java
index e964128..481b5c4 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveReadEntry.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveReadEntry.java
@@ -22,7 +22,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import net.hydromatic.optiq.Schema.TableType;
+import org.apache.calcite.schema.Schema.TableType;
 
 import org.apache.drill.exec.store.hive.HiveTable.HivePartition;
 import org.apache.hadoop.hive.metastore.api.FieldSchema;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java
index a19ebb8..fb827cc 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveStoragePlugin.java
@@ -22,8 +22,8 @@ import java.util.List;
 import java.util.Set;
 import com.google.common.collect.ImmutableSet;
 
-import net.hydromatic.optiq.Schema.TableType;
-import net.hydromatic.optiq.SchemaPlus;
+import org.apache.calcite.schema.Schema.TableType;
+import org.apache.calcite.schema.SchemaPlus;
 
 import org.apache.drill.common.JSONOptions;
 import org.apache.drill.common.exceptions.ExecutionSetupException;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
index a843146..0da28e0 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveTable.java
@@ -33,10 +33,10 @@ import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.sql.SqlCollation;
-import org.eigenbase.sql.type.SqlTypeName;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.sql.SqlCollation;
+import org.apache.calcite.sql.type.SqlTypeName;
 
 import com.google.common.collect.Lists;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveViewTable.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveViewTable.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveViewTable.java
index 52ceccc..1e02301 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveViewTable.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/DrillHiveViewTable.java
@@ -17,7 +17,7 @@
  */
 package org.apache.drill.exec.store.hive.schema;
 
-import net.hydromatic.optiq.Schema.TableType;
+import org.apache.calcite.schema.Schema.TableType;
 
 import org.apache.drill.exec.planner.logical.DrillViewInfoProvider;
 import org.apache.drill.exec.store.hive.HiveReadEntry;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveDatabaseSchema.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveDatabaseSchema.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveDatabaseSchema.java
index 1d2902b..48c034e 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveDatabaseSchema.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveDatabaseSchema.java
@@ -20,7 +20,7 @@ package org.apache.drill.exec.store.hive.schema;
 import java.util.List;
 import java.util.Set;
 
-import net.hydromatic.optiq.Table;
+import org.apache.calcite.schema.Table;
 
 import org.apache.drill.exec.store.AbstractSchema;
 import org.apache.drill.exec.store.hive.HiveStoragePluginConfig;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java
----------------------------------------------------------------------
diff --git a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java
index ec30f01..83f250b 100644
--- a/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java
+++ b/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/schema/HiveSchemaFactory.java
@@ -25,8 +25,8 @@ import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import net.hydromatic.optiq.Schema;
-import net.hydromatic.optiq.SchemaPlus;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
 
 import org.apache.drill.common.exceptions.ExecutionSetupException;
 import org.apache.drill.exec.planner.logical.DrillTable;
@@ -248,7 +248,7 @@ public class HiveSchemaFactory implements SchemaFactory {
     }
 
     @Override
-    public net.hydromatic.optiq.Table getTable(String name) {
+    public org.apache.calcite.schema.Table getTable(String name) {
       if (defaultSchema == null) {
         return super.getTable(name);
       }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoPushDownFilterForScan.java
----------------------------------------------------------------------
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoPushDownFilterForScan.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoPushDownFilterForScan.java
index 1d3b292..4fd80bd 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoPushDownFilterForScan.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoPushDownFilterForScan.java
@@ -27,9 +27,9 @@ import org.apache.drill.exec.planner.logical.RelOptHelper;
 import org.apache.drill.exec.planner.physical.FilterPrel;
 import org.apache.drill.exec.planner.physical.ScanPrel;
 import org.apache.drill.exec.store.StoragePluginOptimizerRule;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rex.RexNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java
----------------------------------------------------------------------
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java
index d291325..38bc91d 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePlugin.java
@@ -20,7 +20,7 @@ package org.apache.drill.exec.store.mongo;
 import java.io.IOException;
 import java.util.Set;
 
-import net.hydromatic.optiq.SchemaPlus;
+import org.apache.calcite.schema.SchemaPlus;
 
 import org.apache.drill.common.JSONOptions;
 import org.apache.drill.common.exceptions.ExecutionSetupException;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoDatabaseSchema.java
----------------------------------------------------------------------
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoDatabaseSchema.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoDatabaseSchema.java
index 5e63d81..0c33ec5 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoDatabaseSchema.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoDatabaseSchema.java
@@ -23,7 +23,7 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentMap;
 
 import com.google.common.collect.Maps;
-import net.hydromatic.optiq.Table;
+import org.apache.calcite.schema.Table;
 
 import org.apache.drill.exec.planner.logical.DrillTable;
 import org.apache.drill.exec.store.AbstractSchema;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
----------------------------------------------------------------------
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
index c941176..c92a35d 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/schema/MongoSchemaFactory.java
@@ -28,8 +28,8 @@ import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
 import com.google.common.collect.Maps;
-import net.hydromatic.optiq.Schema;
-import net.hydromatic.optiq.SchemaPlus;
+import org.apache.calcite.schema.Schema;
+import org.apache.calcite.schema.SchemaPlus;
 
 import org.apache.drill.common.exceptions.ExecutionSetupException;
 import org.apache.drill.exec.planner.logical.DrillTable;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/pom.xml
----------------------------------------------------------------------
diff --git a/exec/java-exec/pom.xml b/exec/java-exec/pom.xml
index 82426ef..64a2079 100644
--- a/exec/java-exec/pom.xml
+++ b/exec/java-exec/pom.xml
@@ -529,7 +529,7 @@
                   <type>jar</type>
                   <overWrite>true</overWrite>
                   <outputDirectory>${project.build.directory}/</outputDirectory>
-                  <includes>**/CombinedParser.jj</includes>
+                  <includes>**/Parser.jj</includes>
                 </artifactItem>
               </artifactItems>
             </configuration>
@@ -631,7 +631,7 @@
             <configuration>
               <sourceDirectory>${project.build.directory}/generated-sources/</sourceDirectory>
               <includes>
-                <include>**/CombinedParser.jj</include>
+                <include>**/Parser.jj</include>
               </includes>
               <lookAhead>2</lookAhead>
               <isStatic>false</isStatic>

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/codegen/data/Parser.tdd
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/codegen/data/Parser.tdd b/exec/java-exec/src/main/codegen/data/Parser.tdd
index 5485079..358b75e 100644
--- a/exec/java-exec/src/main/codegen/data/Parser.tdd
+++ b/exec/java-exec/src/main/codegen/data/Parser.tdd
@@ -22,7 +22,7 @@
   # List of import statements.
   imports: [
     "org.apache.drill.exec.planner.sql.parser.*",
-    "org.eigenbase.util.*",
+    "org.apache.calcite.util.*",
     "java.util.*"
   ]
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/View.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/View.java b/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/View.java
index c5c62d8..97be73d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/View.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/dotdrill/View.java
@@ -19,17 +19,17 @@ package org.apache.drill.exec.dotdrill;
 
 import java.util.List;
 
+import org.apache.calcite.avatica.util.TimeUnit;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeFamily;
 import org.apache.drill.exec.planner.StarColumnHelper;
 import org.apache.drill.exec.planner.types.RelDataTypeDrillImpl;
 import org.apache.drill.exec.planner.types.RelDataTypeHolder;
-
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.sql.SqlIntervalQualifier;
-import org.eigenbase.sql.parser.SqlParserPos;
-import org.eigenbase.sql.type.SqlTypeFamily;
-import org.eigenbase.sql.type.SqlTypeName;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.sql.type.SqlTypeName;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;
@@ -67,8 +67,8 @@ public class View {
         @JsonProperty("type")                       SqlTypeName type,
         @JsonProperty("precision")                  Integer precision,
         @JsonProperty("scale")                      Integer scale,
-        @JsonProperty("startUnit")                  SqlIntervalQualifier.TimeUnit startUnit,
-        @JsonProperty("endUnit")                    SqlIntervalQualifier.TimeUnit endUnit,
+        @JsonProperty("startUnit")                  TimeUnit startUnit,
+        @JsonProperty("endUnit")                    TimeUnit endUnit,
         @JsonProperty("fractionalSecondPrecision")  Integer fractionalSecondPrecision,
         @JsonProperty("isNullable")                 Boolean isNullable) {
       this.name = name;
@@ -108,7 +108,7 @@ public class View {
         break;
       case INTERVAL_YEAR_MONTH:
       case INTERVAL_DAY_TIME:
-        p = dataType.getIntervalQualifier().getStartPrecision();
+        p = dataType.getIntervalQualifier().getStartPrecisionPreservingDefault();
       default:
         break;
       }
@@ -163,7 +163,7 @@ public class View {
      * Gets the time range start unit of the type qualifier of the interval data
      * type descriptor of this field (<i>iff</i> interval type).
      */
-    public SqlIntervalQualifier.TimeUnit getStartUnit() {
+    public TimeUnit getStartUnit() {
       return null == intervalQualifier ? null : intervalQualifier.getStartUnit();
     }
 
@@ -171,7 +171,7 @@ public class View {
      * Gets the time range end unit of the type qualifier of the interval data
      * type descriptor of this field (<i>iff</i> interval type).
      */
-    public SqlIntervalQualifier.TimeUnit getEndUnit() {
+    public TimeUnit getEndUnit() {
       return null == intervalQualifier ? null : intervalQualifier.getEndUnit();
     }
 
@@ -182,7 +182,7 @@ public class View {
      * (<i>iff</i> interval type).
      */
     public Integer getFractionalSecondPrecision() {
-      return null == intervalQualifier ? null : intervalQualifier.getFractionalSecondPrecision();
+      return null == intervalQualifier ? null : intervalQualifier.getFractionalSecondPrecisionPreservingDefault();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFunctionRegistry.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFunctionRegistry.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFunctionRegistry.java
index 8a5af56..398295e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFunctionRegistry.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/DrillFunctionRegistry.java
@@ -32,7 +32,7 @@ import org.apache.drill.exec.planner.logical.DrillConstExecutor;
 import org.apache.drill.exec.planner.sql.DrillOperatorTable;
 import org.apache.drill.exec.planner.sql.DrillSqlAggOperator;
 import org.apache.drill.exec.planner.sql.DrillSqlOperator;
-import org.eigenbase.sql.SqlOperator;
+import org.apache.calcite.sql.SqlOperator;
 
 import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Sets;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java
index 19cd1d8..bf1e252 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionGenerationHelper.java
@@ -29,7 +29,7 @@ import org.apache.drill.common.types.TypeProtos.MinorType;
 import org.apache.drill.common.types.Types;
 import org.apache.drill.exec.expr.ClassGenerator.HoldingContainer;
 import org.apache.drill.exec.expr.HoldingContainerExpression;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 public class FunctionGenerationHelper {
   public static final String COMPARE_TO_NULLS_HIGH = "compare_to_nulls_high";

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
index c566a10..e6d5acd 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java
@@ -23,7 +23,8 @@ import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
-import net.hydromatic.optiq.SchemaPlus;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.jdbc.SimpleCalciteSchema;
 
 import org.apache.drill.common.config.DrillConfig;
 import org.apache.drill.common.exceptions.UserException;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java
index cc02658..bc72779 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/ops/QueryContext.java
@@ -21,8 +21,8 @@ import java.io.IOException;
 import java.util.Collection;
 
 import io.netty.buffer.DrillBuf;
-import net.hydromatic.optiq.SchemaPlus;
-import net.hydromatic.optiq.jdbc.SimpleOptiqSchema;
+import org.apache.calcite.schema.SchemaPlus;
+import org.apache.calcite.jdbc.SimpleCalciteSchema;
 
 import org.apache.drill.common.config.DrillConfig;
 import org.apache.drill.exec.ExecConstants;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/opt/BasicOptimizer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/opt/BasicOptimizer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/opt/BasicOptimizer.java
index 9e60f21..6e70506 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/opt/BasicOptimizer.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/opt/BasicOptimizer.java
@@ -56,8 +56,9 @@ import org.apache.drill.exec.physical.config.WindowPOP;
 import org.apache.drill.exec.rpc.user.UserServer.UserClientConnection;
 import org.apache.drill.exec.server.options.OptionManager;
 import org.apache.drill.exec.store.StoragePlugin;
-import org.eigenbase.rel.RelFieldCollation.Direction;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.drill.exec.work.foreman.ForemanException;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 import java.io.IOException;
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/HashJoinPOP.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/HashJoinPOP.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/HashJoinPOP.java
index f9cae48..80613f5 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/HashJoinPOP.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/HashJoinPOP.java
@@ -26,7 +26,7 @@ import org.apache.drill.exec.physical.base.AbstractBase;
 import org.apache.drill.exec.physical.base.PhysicalOperator;
 import org.apache.drill.exec.physical.base.PhysicalVisitor;
 import org.apache.drill.exec.proto.UserBitShared.CoreOperatorType;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MergeJoinPOP.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MergeJoinPOP.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MergeJoinPOP.java
index 19f9b08..47505ab 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MergeJoinPOP.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MergeJoinPOP.java
@@ -25,7 +25,7 @@ import org.apache.drill.exec.physical.base.AbstractBase;
 import org.apache.drill.exec.physical.base.PhysicalOperator;
 import org.apache.drill.exec.physical.base.PhysicalVisitor;
 import org.apache.drill.exec.proto.UserBitShared.CoreOperatorType;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/NestedLoopJoinPOP.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/NestedLoopJoinPOP.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/NestedLoopJoinPOP.java
index 8fcade6..fd584ea 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/NestedLoopJoinPOP.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/NestedLoopJoinPOP.java
@@ -26,7 +26,7 @@ import org.apache.drill.exec.physical.base.AbstractBase;
 import org.apache.drill.exec.physical.base.PhysicalOperator;
 import org.apache.drill.exec.physical.base.PhysicalVisitor;
 import org.apache.drill.exec.proto.UserBitShared.CoreOperatorType;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java
index a73bdad..681c3e3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/TopN/TopNBatch.java
@@ -60,8 +60,8 @@ import org.apache.drill.exec.record.selection.SelectionVector2;
 import org.apache.drill.exec.record.selection.SelectionVector4;
 import org.apache.drill.exec.vector.ValueVector;
 import org.apache.drill.exec.vector.complex.AbstractContainerVector;
-import org.eigenbase.rel.RelFieldCollation.Direction;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 import com.google.common.base.Stopwatch;
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
index b2fae8d..79fe177 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinBatch.java
@@ -56,7 +56,7 @@ import org.apache.drill.exec.record.VectorContainer;
 import org.apache.drill.exec.record.VectorWrapper;
 import org.apache.drill.exec.vector.ValueVector;
 import org.apache.drill.exec.vector.complex.AbstractContainerVector;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.sun.codemodel.JExpr;
 import com.sun.codemodel.JExpression;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbe.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbe.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbe.java
index 42c7010..cc6bd55 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbe.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbe.java
@@ -27,7 +27,7 @@ import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.physical.impl.common.HashTable;
 import org.apache.drill.exec.record.RecordBatch;
 import org.apache.drill.exec.record.VectorContainer;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 public interface HashJoinProbe {
   public static TemplateClassDefinition<HashJoinProbe> TEMPLATE_DEFINITION = new TemplateClassDefinition<HashJoinProbe>(HashJoinProbe.class, HashJoinProbeTemplate.class);

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
index dcf73b4..5531bc7 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/HashJoinProbeTemplate.java
@@ -31,7 +31,7 @@ import org.apache.drill.exec.record.RecordBatch;
 import org.apache.drill.exec.record.RecordBatch.IterOutcome;
 import org.apache.drill.exec.record.VectorContainer;
 import org.apache.drill.exec.record.VectorWrapper;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 public abstract class HashJoinProbeTemplate implements HashJoinProbe {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
index 5fb2585..8f72d32 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinStatus.java
@@ -23,7 +23,7 @@ import org.apache.drill.exec.record.RecordBatch;
 import org.apache.drill.exec.record.RecordBatch.IterOutcome;
 import org.apache.drill.exec.record.VectorWrapper;
 import org.apache.drill.exec.record.selection.SelectionVector4;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 /**
  * The status of the current join.  Maintained outside the individually compiled join templates so that we can carry status across multiple schemas.

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
index 6da10d2..bb43e83 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinTemplate.java
@@ -23,7 +23,7 @@ import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.physical.config.MergeJoinPOP;
 import org.apache.drill.exec.record.VectorContainer;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 /**
  * This join template uses a merge join to combine two ordered streams into a single larger batch.  When joining

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java
index 7fa79a1..41bf786 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/JoinUtils.java
@@ -18,13 +18,12 @@
 
 package org.apache.drill.exec.physical.impl.join;
 
+import org.apache.calcite.rel.core.Join;
+import org.apache.calcite.rel.core.JoinRelType;
+import org.apache.calcite.rex.RexNode;
 import org.apache.drill.common.logical.data.JoinCondition;
-import org.eigenbase.rel.JoinRelBase;
-import org.eigenbase.rel.JoinRelType;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptTable;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptUtil;
 
 import java.util.List;
 
@@ -74,11 +73,11 @@ public class JoinUtils {
      *                  Otherwise, return false
      */
   public static boolean checkCartesianJoin(RelNode relNode, List<Integer> leftKeys, List<Integer> rightKeys) {
-    if (relNode instanceof JoinRelBase) {
+    if (relNode instanceof Join) {
       leftKeys.clear();
       rightKeys.clear();
 
-      JoinRelBase joinRel = (JoinRelBase) relNode;
+      Join joinRel = (Join) relNode;
       RelNode left = joinRel.getLeft();
       RelNode right = joinRel.getRight();
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
index 8fce52e..b5cb12e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java
@@ -55,7 +55,7 @@ import org.apache.drill.exec.record.VectorWrapper;
 import org.apache.drill.exec.vector.AllocationHelper;
 import org.apache.drill.exec.vector.ValueVector;
 import org.apache.drill.exec.vector.complex.AbstractContainerVector;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.google.common.base.Preconditions;
 import com.sun.codemodel.JClass;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinCreator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinCreator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinCreator.java
index d6b566c..7d100af 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinCreator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinCreator.java
@@ -24,7 +24,7 @@ import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.physical.config.MergeJoinPOP;
 import org.apache.drill.exec.physical.impl.BatchCreator;
 import org.apache.drill.exec.record.RecordBatch;
-import org.eigenbase.rel.JoinRelType;
+import org.apache.calcite.rel.core.JoinRelType;
 
 import com.google.common.base.Preconditions;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
index b8ef690..3cf2857 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/mergereceiver/MergingRecordBatch.java
@@ -75,7 +75,8 @@ import org.apache.drill.exec.vector.AllocationHelper;
 import org.apache.drill.exec.vector.CopyUtil;
 import org.apache.drill.exec.vector.FixedWidthVector;
 import org.apache.drill.exec.vector.ValueVector;
-import org.eigenbase.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 import parquet.Preconditions;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java
index 42b1080..b26c78a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/orderedpartitioner/OrderedPartitionRecordBatch.java
@@ -69,8 +69,8 @@ import org.apache.drill.exec.record.selection.SelectionVector4;
 import org.apache.drill.exec.vector.AllocationHelper;
 import org.apache.drill.exec.vector.IntVector;
 import org.apache.drill.exec.vector.ValueVector;
-import org.eigenbase.rel.RelFieldCollation.Direction;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java
index 6f19e91..0a097c1 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortBatch.java
@@ -42,8 +42,8 @@ import org.apache.drill.exec.record.VectorAccessible;
 import org.apache.drill.exec.record.WritableBatch;
 import org.apache.drill.exec.record.selection.SelectionVector2;
 import org.apache.drill.exec.record.selection.SelectionVector4;
-import org.eigenbase.rel.RelFieldCollation.Direction;
-import org.eigenbase.rel.RelFieldCollation.NullDirection;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.NullDirection;
 
 import com.sun.codemodel.JConditional;
 import com.sun.codemodel.JExpr;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
index 95d062c..ca93a72 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
@@ -66,7 +66,7 @@ import org.apache.drill.exec.vector.ValueVector;
 import org.apache.drill.exec.vector.complex.AbstractContainerVector;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
-import org.eigenbase.rel.RelFieldCollation.Direction;
+import org.apache.calcite.rel.RelFieldCollation.Direction;
 
 import com.google.common.base.Stopwatch;
 import com.google.common.collect.Iterators;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/StarColumnHelper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/StarColumnHelper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/StarColumnHelper.java
index d288479..9034f01 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/StarColumnHelper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/StarColumnHelper.java
@@ -22,9 +22,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.rex.RexInputRef;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexInputRef;
+import org.apache.calcite.rex.RexNode;
 
 public class StarColumnHelper {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillAggregateRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillAggregateRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillAggregateRelBase.java
index c733f77..e0f9e34 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillAggregateRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillAggregateRelBase.java
@@ -21,24 +21,25 @@ import java.util.BitSet;
 import java.util.List;
 
 import org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory;
-import org.eigenbase.rel.AggregateCall;
-import org.eigenbase.rel.AggregateRelBase;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptPlanner;
-import org.eigenbase.relopt.RelTraitSet;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.rel.core.Aggregate;
+import org.apache.calcite.rel.core.AggregateCall;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.util.ImmutableBitSet;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelTraitSet;
 
 
 /**
  * Base class for logical and physical Aggregations implemented in Drill
  */
-public abstract class DrillAggregateRelBase extends AggregateRelBase implements DrillRelNode {
+public abstract class DrillAggregateRelBase extends Aggregate implements DrillRelNode {
 
-  public DrillAggregateRelBase(RelOptCluster cluster, RelTraitSet traits, RelNode child, BitSet groupSet,
-      List<AggregateCall> aggCalls) throws InvalidRelException {
-    super(cluster, traits, child, groupSet, aggCalls);
+  public DrillAggregateRelBase(RelOptCluster cluster, RelTraitSet traits, RelNode child, boolean indicator,
+      ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) throws InvalidRelException {
+    super(cluster, traits, child, indicator, groupSet, groupSets, aggCalls);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillFilterRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillFilterRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillFilterRelBase.java
index 7813d15..c52dede 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillFilterRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillFilterRelBase.java
@@ -23,24 +23,25 @@ import org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory;
 import org.apache.drill.exec.planner.logical.DrillOptiq;
 import org.apache.drill.exec.planner.logical.DrillParseContext;
 import org.apache.drill.exec.planner.physical.PrelUtil;
-import org.eigenbase.rel.FilterRelBase;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.metadata.RelMetadataQuery;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptPlanner;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexUtil;
+
+import org.apache.calcite.rel.core.Filter;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexUtil;
 
 import java.util.List;
 
 /**
  * Base class for logical and physical Filters implemented in Drill
  */
-public abstract class DrillFilterRelBase extends FilterRelBase implements DrillRelNode {
+public abstract class DrillFilterRelBase extends Filter implements DrillRelNode {
   private final int numConjuncts;
   private final List<RexNode> conjunctions;
 
@@ -52,7 +53,7 @@ public abstract class DrillFilterRelBase extends FilterRelBase implements DrillR
     // that repeated calls to the costing function can use the saved copy
     conjunctions = RelOptUtil.conjunctions(condition);
     numConjuncts = conjunctions.size();
-    assert numConjuncts >= 1;
+    // assert numConjuncts >= 1;
 
   }
 
@@ -61,7 +62,7 @@ public abstract class DrillFilterRelBase extends FilterRelBase implements DrillR
     if(PrelUtil.getSettings(getCluster()).useDefaultCosting()) {
       return super.computeSelfCost(planner).multiplyBy(.1);
     }
-    RelNode child = this.getChild();
+    RelNode child = this.getInput();
     double inputRows = RelMetadataQuery.getRowCount(child);
     double cpuCost = estimateCpuCost();
     DrillCostFactory costFactory = (DrillCostFactory)planner.getCostFactory();
@@ -69,7 +70,7 @@ public abstract class DrillFilterRelBase extends FilterRelBase implements DrillR
   }
 
   protected LogicalExpression getFilterExpression(DrillParseContext context){
-    return DrillOptiq.toDrill(context, getChild(), getCondition());
+    return DrillOptiq.toDrill(context, getInput(), getCondition());
   }
 
   /* Given the condition (C1 and C2 and C3 and ... C_n), here is how to estimate cpu cost of FILTER :
@@ -78,12 +79,12 @@ public abstract class DrillFilterRelBase extends FilterRelBase implements DrillR
   *  cpu_cost = #_of_comparison * DrillCostBase_COMPARE_CPU_COST;
   */
   private double estimateCpuCost() {
-    RelNode child = this.getChild();
+    RelNode child = this.getInput();
     double compNum = RelMetadataQuery.getRowCount(child);
 
     for (int i = 0; i< numConjuncts; i++) {
       RexNode conjFilter = RexUtil.composeConjunction(this.getCluster().getRexBuilder(), conjunctions.subList(0, i + 1), false);
-      compNum += FilterRelBase.estimateFilteredRows(child, conjFilter);
+      compNum += Filter.estimateFilteredRows(child, conjFilter);
     }
 
     return compNum * DrillCostBase.COMPARE_CPU_COST;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillJoinRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillJoinRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillJoinRelBase.java
index 3b3aa1a..73ccf23 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillJoinRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillJoinRelBase.java
@@ -23,23 +23,23 @@ import java.util.List;
 
 import org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory;
 import org.apache.drill.exec.planner.physical.PrelUtil;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.JoinRelBase;
-import org.eigenbase.rel.JoinRelType;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptPlanner;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.core.Join;
+import org.apache.calcite.rel.core.JoinRelType;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexNode;
 
 import com.google.common.collect.Lists;
 
 /**
  * Base class for logical and physical Joins implemented in Drill.
  */
-public abstract class DrillJoinRelBase extends JoinRelBase implements DrillRelNode {
+public abstract class DrillJoinRelBase extends Join implements DrillRelNode {
   protected List<Integer> leftKeys = Lists.newArrayList();
   protected List<Integer> rightKeys = Lists.newArrayList() ;
   private final double joinRowFactor;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillLimitRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillLimitRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillLimitRelBase.java
index 11164fb..a19dff7 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillLimitRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillLimitRelBase.java
@@ -20,15 +20,15 @@ package org.apache.drill.exec.planner.common;
 import org.apache.drill.exec.planner.cost.DrillCostBase;
 import org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory;
 import org.apache.drill.exec.planner.physical.PrelUtil;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.RelWriter;
-import org.eigenbase.rel.SingleRel;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptPlanner;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.rex.RexLiteral;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelWriter;
+import org.apache.calcite.rel.SingleRel;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexNode;
 
 /**
  * Base class for logical and physical Limits implemented in Drill

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillProjectRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillProjectRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillProjectRelBase.java
index 7cf98cd..51b4e3f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillProjectRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillProjectRelBase.java
@@ -30,17 +30,17 @@ import org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory;
 import org.apache.drill.exec.planner.logical.DrillOptiq;
 import org.apache.drill.exec.planner.logical.DrillParseContext;
 import org.apache.drill.exec.planner.physical.PrelUtil;
-import org.eigenbase.rel.ProjectRelBase;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.metadata.RelMetadataQuery;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptPlanner;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.util.Pair;
+import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.util.Pair;
 
 import com.google.common.collect.Lists;
 
@@ -48,7 +48,7 @@ import com.google.common.collect.Lists;
  *
  * Base class for logical and physical Project implemented in Drill
  */
-public abstract class DrillProjectRelBase extends ProjectRelBase implements DrillRelNode {
+public abstract class DrillProjectRelBase extends Project implements DrillRelNode {
   protected DrillProjectRelBase(Convention convention, RelOptCluster cluster, RelTraitSet traits, RelNode child, List<RexNode> exps,
       RelDataType rowType) {
     super(cluster, traits, child, exps, rowType, Flags.BOXED);
@@ -93,7 +93,7 @@ public abstract class DrillProjectRelBase extends ProjectRelBase implements Dril
 
     for (Pair<RexNode, String> pair : projects()) {
       if (! StarColumnHelper.subsumeColumn(starColPrefixes, pair.right)) {
-        LogicalExpression expr = DrillOptiq.toDrill(context, getChild(), pair.left);
+        LogicalExpression expr = DrillOptiq.toDrill(context, getInput(), pair.left);
         expressions.add(new NamedExpression(expr, FieldReference.getWithQuotedRef(pair.right)));
       }
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelNode.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelNode.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelNode.java
index fd04cdd..a59b5cd 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelNode.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelNode.java
@@ -18,7 +18,7 @@
 
 package org.apache.drill.exec.planner.common;
 
-import org.eigenbase.rel.RelNode;
+import org.apache.calcite.rel.RelNode;
 
 public interface DrillRelNode extends RelNode {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelOptUtil.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelOptUtil.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelOptUtil.java
index bbe7cf3..cea8fec 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelOptUtil.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillRelOptUtil.java
@@ -21,18 +21,18 @@ import java.util.AbstractList;
 import java.util.List;
 
 import com.google.common.collect.Lists;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.logical.LogicalCalc;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexInputRef;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.util.Pair;
 import org.apache.drill.common.types.TypeProtos;
 import org.apache.drill.common.types.Types;
-import org.apache.drill.exec.planner.logical.DrillOptiq;
 import org.apache.drill.exec.resolver.TypeCastRules;
-import org.eigenbase.rel.CalcRel;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexInputRef;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.sql.type.SqlTypeName;
-import org.eigenbase.util.Pair;
 
 /**
  * Utility class that is a subset of the RelOptUtil class and is a placeholder for Drill specific
@@ -116,6 +116,7 @@ public abstract class DrillRelOptUtil {
                 fieldNames.get(index));
           }
         };
-    return CalcRel.createProject(rel, refs, true);
+    return RelOptUtil.createRename(rel, fieldNames);
+    // return Calc.createProject(rel, refs, true);
   }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScanRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScanRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScanRelBase.java
index 33581a3..9da7d36 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScanRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScanRelBase.java
@@ -18,18 +18,18 @@
 package org.apache.drill.exec.planner.common;
 
 import org.apache.drill.exec.planner.logical.DrillTable;
-import org.eigenbase.rel.TableAccessRelBase;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptTable;
-import org.eigenbase.relopt.RelTraitSet;
+import org.apache.calcite.rel.core.TableScan;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.plan.RelTraitSet;
 
 /**
  * Base class for logical scan rel implemented in Drill.
  * NOTE: we should eventually make this class independent of TableAccessRelBase and then
  * make it the base class for logical and physical scan rels.
  */
-public abstract class DrillScanRelBase extends TableAccessRelBase implements DrillRelNode {
+public abstract class DrillScanRelBase extends TableScan implements DrillRelNode {
   protected final DrillTable drillTable;
 
   public DrillScanRelBase(Convention convention, RelOptCluster cluster, RelTraitSet traits, RelOptTable table) {


Mime
View raw message