drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [09/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:12 GMT
http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScreenRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScreenRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScreenRelBase.java
index 9b31fb0..ab5287e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScreenRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillScreenRelBase.java
@@ -19,14 +19,14 @@ package org.apache.drill.exec.planner.common;
 
 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.SingleRel;
-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.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.SingleRel;
+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;
 
 /**
  * Base class for logical and physical Screen 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/DrillStoreRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillStoreRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillStoreRelBase.java
index adf7d6b..d61f271 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillStoreRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillStoreRelBase.java
@@ -19,18 +19,18 @@ package org.apache.drill.exec.planner.common;
 
 import java.util.List;
 
-import net.hydromatic.optiq.prepare.Prepare.CatalogReader;
+import org.apache.calcite.prepare.Prepare.CatalogReader;
 
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.TableModificationRelBase;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptTable;
-import org.eigenbase.relopt.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.TableModify;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.plan.RelTraitSet;
 
 /**
  * Base class for logical and physical Store implemented in Drill
  */
-public abstract class DrillStoreRelBase extends TableModificationRelBase implements DrillRelNode {
+public abstract class DrillStoreRelBase extends TableModify implements DrillRelNode {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillStoreRelBase.class);
 
   protected DrillStoreRelBase(RelOptCluster cluster, RelTraitSet traits, RelOptTable table, CatalogReader catalogReader,

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillUnionRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillUnionRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillUnionRelBase.java
index 11ed8ba..bb977c6 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillUnionRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillUnionRelBase.java
@@ -19,17 +19,17 @@ package org.apache.drill.exec.planner.common;
 
 import java.util.List;
 
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.UnionRelBase;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataType;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Union;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataType;
 
 /**
  * Base class for logical and physical Union implemented in Drill
  */
-public abstract class DrillUnionRelBase extends UnionRelBase implements DrillRelNode {
+public abstract class DrillUnionRelBase extends Union implements DrillRelNode {
 
   public DrillUnionRelBase(RelOptCluster cluster, RelTraitSet traits,
       List<RelNode> inputs, boolean all, boolean checkCompatibility) throws InvalidRelException {

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWindowRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWindowRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWindowRelBase.java
index fcf52ee..272137d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWindowRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWindowRelBase.java
@@ -18,16 +18,16 @@
 
 package org.apache.drill.exec.planner.common;
 
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.WindowRelBase;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.rex.RexLiteral;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Window;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexLiteral;
 
 import java.util.List;
 
-public class DrillWindowRelBase extends WindowRelBase implements DrillRelNode {
+public class DrillWindowRelBase extends Window implements DrillRelNode {
 
   public DrillWindowRelBase(
       RelOptCluster cluster,
@@ -35,7 +35,7 @@ public class DrillWindowRelBase extends WindowRelBase implements DrillRelNode {
       RelNode child,
       List<RexLiteral> constants,
       RelDataType rowType,
-      List<Window> windows) {
+      List<Group> windows) {
     super(cluster, traits, child, constants, rowType, windows);
   }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWriterRelBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWriterRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWriterRelBase.java
index 7ea98a4..9ccaeb2 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWriterRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillWriterRelBase.java
@@ -20,13 +20,13 @@ package org.apache.drill.exec.planner.common;
 import java.util.List;
 
 import org.apache.drill.exec.planner.logical.CreateTableEntry;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.SingleRel;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.sql.type.SqlTypeName;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.SingleRel;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.type.SqlTypeName;
 
 import com.google.common.collect.ImmutableList;
 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/planner/cost/DrillCostBase.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillCostBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillCostBase.java
index 87a1ea3..0e032f9 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillCostBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillCostBase.java
@@ -18,9 +18,9 @@
 
 package org.apache.drill.exec.planner.cost;
 
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.util.Util;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.util.Util;
 
 /**
  * Implementation of the DrillRelOptCost, modeled similar to VolcanoCost

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCost.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCost.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCost.java
index 73c6c72..8c4db17 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCost.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCost.java
@@ -18,7 +18,8 @@
 
 package org.apache.drill.exec.planner.cost;
 
-import org.eigenbase.relopt.RelOptCost;
+import org.apache.calcite.plan.RelOptCost;
+
 
 public interface DrillRelOptCost extends RelOptCost {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCostFactory.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCostFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCostFactory.java
index fc20d60..f8c0943 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCostFactory.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelOptCostFactory.java
@@ -19,8 +19,8 @@
 
 package org.apache.drill.exec.planner.cost;
 
-import org.eigenbase.relopt.RelOptCost;
-import org.eigenbase.relopt.RelOptCostFactory;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptCostFactory;
 
 public interface DrillRelOptCostFactory extends RelOptCostFactory {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DirPathBuilder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DirPathBuilder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DirPathBuilder.java
index cb38da9..892e8cb 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DirPathBuilder.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DirPathBuilder.java
@@ -23,23 +23,23 @@ import java.util.List;
 import org.apache.drill.common.expression.FieldReference;
 import org.apache.drill.common.expression.SchemaPath;
 import org.apache.drill.exec.planner.PartitionDescriptor;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexBuilder;
-import org.eigenbase.rex.RexCall;
-import org.eigenbase.rex.RexCorrelVariable;
-import org.eigenbase.rex.RexDynamicParam;
-import org.eigenbase.rex.RexFieldAccess;
-import org.eigenbase.rex.RexInputRef;
-import org.eigenbase.rex.RexLiteral;
-import org.eigenbase.rex.RexLocalRef;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexOver;
-import org.eigenbase.rex.RexRangeRef;
-import org.eigenbase.rex.RexUtil;
-import org.eigenbase.rex.RexVisitorImpl;
-import org.eigenbase.sql.SqlKind;
-import org.eigenbase.sql.SqlSyntax;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexCorrelVariable;
+import org.apache.calcite.rex.RexDynamicParam;
+import org.apache.calcite.rex.RexFieldAccess;
+import org.apache.calcite.rex.RexInputRef;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexLocalRef;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexOver;
+import org.apache.calcite.rex.RexRangeRef;
+import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.rex.RexVisitorImpl;
+import org.apache.calcite.sql.SqlKind;
+import org.apache.calcite.sql.SqlSyntax;
 
 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/planner/logical/DrillAggregateRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRel.java
index ee035c6..5419315 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRel.java
@@ -20,9 +20,9 @@ package org.apache.drill.exec.planner.logical;
 import java.util.BitSet;
 import java.util.List;
 
-import net.hydromatic.linq4j.Ord;
-import net.hydromatic.optiq.util.BitSets;
-
+import org.apache.calcite.linq4j.Ord;
+import org.apache.calcite.util.BitSets;
+import org.apache.calcite.util.ImmutableBitSet;
 import org.apache.drill.common.expression.ExpressionPosition;
 import org.apache.drill.common.expression.FieldReference;
 import org.apache.drill.common.expression.FunctionCallFactory;
@@ -32,12 +32,12 @@ import org.apache.drill.common.logical.data.GroupingAggregate;
 import org.apache.drill.common.logical.data.LogicalOperator;
 import org.apache.drill.exec.planner.common.DrillAggregateRelBase;
 import org.apache.drill.exec.planner.torel.ConversionContext;
-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.RelTraitSet;
+import org.apache.calcite.rel.core.AggregateCall;
+import org.apache.calcite.rel.core.Aggregate;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
 
 import com.google.common.collect.Lists;
 
@@ -46,15 +46,15 @@ import com.google.common.collect.Lists;
  */
 public class DrillAggregateRel extends DrillAggregateRelBase implements DrillRel {
   /** Creates a DrillAggregateRel. */
-  public DrillAggregateRel(RelOptCluster cluster, RelTraitSet traits, RelNode child, BitSet groupSet,
-      List<AggregateCall> aggCalls) throws InvalidRelException {
-    super(cluster, traits, child, groupSet, aggCalls);
+  public DrillAggregateRel(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
-  public AggregateRelBase copy(RelTraitSet traitSet, RelNode input, BitSet groupSet, List<AggregateCall> aggCalls) {
+  public Aggregate copy(RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) {
     try {
-      return new DrillAggregateRel(getCluster(), traitSet, input, getGroupSet(), aggCalls);
+      return new DrillAggregateRel(getCluster(), traitSet, input, indicator, groupSet, groupSets, aggCalls);
     } catch (InvalidRelException e) {
       throw new AssertionError(e);
     }
@@ -64,8 +64,8 @@ public class DrillAggregateRel extends DrillAggregateRelBase implements DrillRel
   public LogicalOperator implement(DrillImplementor implementor) {
 
     GroupingAggregate.Builder builder = GroupingAggregate.builder();
-    builder.setInput(implementor.visitChild(this, 0, getChild()));
-    final List<String> childFields = getChild().getRowType().getFieldNames();
+    builder.setInput(implementor.visitChild(this, 0, getInput()));
+    final List<String> childFields = getInput().getRowType().getFieldNames();
     final List<String> fields = getRowType().getFieldNames();
 
     for (int group : BitSets.toIter(groupSet)) {

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRule.java
index 66fc563..0ca4447 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillAggregateRule.java
@@ -19,30 +19,31 @@ package org.apache.drill.exec.planner.logical;
 
 import java.util.logging.Logger;
 
-import org.eigenbase.rel.AggregateRel;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.trace.EigenbaseTrace;
+import org.apache.calcite.rel.core.Aggregate;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.logical.LogicalAggregate;
+import org.apache.calcite.util.trace.CalciteTrace;
 
 /**
- * Rule that converts an {@link AggregateRel} to a {@link DrillAggregateRel}, implemented by a Drill "segment" operation
+ * Rule that converts an {@link LogicalAggregate} to a {@link DrillAggregateRel}, implemented by a Drill "segment" operation
  * followed by a "collapseaggregate" operation.
  */
 public class DrillAggregateRule extends RelOptRule {
   public static final RelOptRule INSTANCE = new DrillAggregateRule();
-  protected static final Logger tracer = EigenbaseTrace.getPlannerTracer();
+  protected static final Logger tracer = CalciteTrace.getPlannerTracer();
 
   private DrillAggregateRule() {
-    super(RelOptHelper.some(AggregateRel.class, Convention.NONE, RelOptHelper.any(RelNode.class)), "DrillAggregateRule");
+    super(RelOptHelper.some(LogicalAggregate.class, Convention.NONE, RelOptHelper.any(RelNode.class)), "DrillAggregateRule");
   }
 
   @Override
   public void onMatch(RelOptRuleCall call) {
-    final AggregateRel aggregate = (AggregateRel) call.rel(0);
+    final LogicalAggregate aggregate = (LogicalAggregate) call.rel(0);
     final RelNode input = call.rel(1);
 
     if (aggregate.containsDistinctCall()) {
@@ -53,8 +54,8 @@ public class DrillAggregateRule extends RelOptRule {
     final RelTraitSet traits = aggregate.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
     final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
     try {
-      call.transformTo(new DrillAggregateRel(aggregate.getCluster(), traits, convertedInput, aggregate.getGroupSet(),
-          aggregate.getAggCallList()));
+      call.transformTo(new DrillAggregateRel(aggregate.getCluster(), traits, convertedInput, aggregate.indicator,
+          aggregate.getGroupSet(), aggregate.getGroupSets(), aggregate.getAggCallList()));
     } catch (InvalidRelException e) {
       tracer.warning(e.toString());
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConditions.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConditions.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConditions.java
index 310ef82..f68007d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConditions.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConditions.java
@@ -17,9 +17,9 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.rules.PushProjector;
-import org.eigenbase.rex.RexCall;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.rules.PushProjector;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexNode;
 
 public final class DrillConditions {
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConstExecutor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConstExecutor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConstExecutor.java
index 0fe5a1a..92e5678 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConstExecutor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillConstExecutor.java
@@ -19,7 +19,7 @@ package org.apache.drill.exec.planner.logical;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
-import net.hydromatic.avatica.ByteString;
+import org.apache.calcite.avatica.util.TimeUnit;
 import org.apache.drill.common.exceptions.DrillRuntimeException;
 import org.apache.drill.common.expression.ErrorCollectorImpl;
 import org.apache.drill.common.expression.ExpressionStringBuilder;
@@ -46,19 +46,17 @@ import org.apache.drill.exec.expr.holders.IntervalYearHolder;
 import org.apache.drill.exec.expr.holders.TimeHolder;
 import org.apache.drill.exec.expr.holders.TimeStampHolder;
 import org.apache.drill.exec.expr.holders.ValueHolder;
-import org.apache.drill.exec.expr.holders.VarBinaryHolder;
 import org.apache.drill.exec.expr.holders.VarCharHolder;
 import org.apache.drill.exec.ops.UdfUtilities;
-import org.apache.drill.exec.vector.VarCharVector;
-import org.eigenbase.relopt.RelOptPlanner;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.rex.RexBuilder;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.sql.SqlIntervalQualifier;
-import org.eigenbase.sql.parser.SqlParserPos;
-import org.eigenbase.sql.type.SqlTypeName;
-import org.eigenbase.util.NlsString;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeFactory;
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlIntervalQualifier;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.calcite.sql.type.SqlTypeName;
+import org.apache.calcite.util.NlsString;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
@@ -137,14 +135,14 @@ public class DrillConstExecutor implements RelOptPlanner.Executor {
     if (sqlTypeName == SqlTypeName.INTERVAL_DAY_TIME) {
       type = typeFactory.createSqlIntervalType(
           new SqlIntervalQualifier(
-              SqlIntervalQualifier.TimeUnit.DAY,
-              SqlIntervalQualifier.TimeUnit.MINUTE,
+              TimeUnit.DAY,
+              TimeUnit.MINUTE,
               SqlParserPos.ZERO));
     } else if (sqlTypeName == SqlTypeName.INTERVAL_YEAR_MONTH) {
       type = typeFactory.createSqlIntervalType(
           new SqlIntervalQualifier(
-              SqlIntervalQualifier.TimeUnit.YEAR,
-              SqlIntervalQualifier.TimeUnit.MONTH,
+              TimeUnit.YEAR,
+              TimeUnit.MONTH,
              SqlParserPos.ZERO));
     } else if (sqlTypeName == SqlTypeName.VARCHAR) {
       type = typeFactory.createSqlType(sqlTypeName, TypeHelper.VARCHAR_DEFAULT_CAST_LEN);

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java
index 63bef44..a914f47 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRel.java
@@ -19,15 +19,15 @@ package org.apache.drill.exec.planner.logical;
 
 import java.util.List;
 
+import org.apache.calcite.plan.RelTraitSet;
 import org.apache.drill.common.logical.data.Filter;
 import org.apache.drill.common.logical.data.LogicalOperator;
 import org.apache.drill.exec.planner.common.DrillFilterRelBase;
 import org.apache.drill.exec.planner.torel.ConversionContext;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.rex.RexNode;
 
 
 public class DrillFilterRel extends DrillFilterRelBase implements DrillRel {
@@ -36,19 +36,19 @@ public class DrillFilterRel extends DrillFilterRelBase implements DrillRel {
   }
 
   @Override
-  public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) {
-    return new DrillFilterRel(getCluster(), traitSet, sole(inputs), getCondition());
+  public org.apache.calcite.rel.core.Filter copy(RelTraitSet traitSet, RelNode input, RexNode condition) {
+    return new DrillFilterRel(getCluster(), traitSet, input, condition);
   }
 
   @Override
   public LogicalOperator implement(DrillImplementor implementor) {
-    final LogicalOperator input = implementor.visitChild(this, 0, getChild());
-    Filter f = new Filter(getFilterExpression(implementor.getContext()));
+    final LogicalOperator input = implementor.visitChild(this, 0, getInput());
+    org.apache.drill.common.logical.data.Filter f = new org.apache.drill.common.logical.data.Filter(getFilterExpression(implementor.getContext()));
     f.setInput(input);
     return f;
   }
 
-  public static DrillFilterRel convert(Filter filter, ConversionContext context) throws InvalidRelException{
+  public static DrillFilterRel convert(org.apache.drill.common.logical.data.Filter filter, ConversionContext context) throws InvalidRelException{
     RelNode input = context.toRel(filter.getInput());
     return new DrillFilterRel(context.getCluster(), context.getLogicalTraits(), input, context.toRex(filter.getExpr()));
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRule.java
index cb47adb..dd7da48 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillFilterRule.java
@@ -17,26 +17,28 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.FilterRel;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rel.logical.LogicalFilter;
 
 /**
- * Rule that converts a {@link org.eigenbase.rel.FilterRel} to a Drill "filter" operation.
+ * Rule that converts a {@link org.apache.calcite.rel.FilterRel} to a Drill "filter" operation.
  */
 public class DrillFilterRule extends RelOptRule {
   public static final RelOptRule INSTANCE = new DrillFilterRule();
 
   private DrillFilterRule() {
-    super(RelOptHelper.any(FilterRel.class, Convention.NONE), "DrillFilterRule");
+    super(RelOptHelper.any(LogicalFilter.class, Convention.NONE), "DrillFilterRule");
   }
 
   @Override
   public void onMatch(RelOptRuleCall call) {
-    final FilterRel filter = (FilterRel) call.rel(0);
-    final RelNode input = filter.getChild();
+    final LogicalFilter filter = (LogicalFilter) call.rel(0);
+    final RelNode input = filter.getInput();
     //final RelTraitSet traits = filter.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
     final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
     call.transformTo(new DrillFilterRel(filter.getCluster(), convertedInput.getTraitSet(), convertedInput, filter.getCondition()));

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillImplementor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillImplementor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillImplementor.java
index 7fff6e9..fed7e06 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillImplementor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillImplementor.java
@@ -19,13 +19,14 @@ package org.apache.drill.exec.planner.logical;
 
 import java.util.Set;
 
+import org.apache.calcite.rel.RelNode;
 import org.apache.drill.common.logical.LogicalPlan;
 import org.apache.drill.common.logical.LogicalPlanBuilder;
 import org.apache.drill.common.logical.PlanProperties.Generator.ResultMode;
 import org.apache.drill.common.logical.PlanProperties.PlanType;
 import org.apache.drill.common.logical.data.LogicalOperator;
 import org.apache.drill.common.logical.data.visitors.AbstractLogicalVisitor;
-import org.eigenbase.rel.RelNode;
+import org.apache.calcite.rel.RelNode;
 
 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/planner/logical/DrillJoinRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRel.java
index 8d3e1bf..1f602c7 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRel.java
@@ -27,17 +27,17 @@ import org.apache.drill.common.logical.data.LogicalOperator;
 import org.apache.drill.common.logical.data.Project;
 import org.apache.drill.exec.planner.common.DrillJoinRelBase;
 import org.apache.drill.exec.planner.torel.ConversionContext;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.JoinRelType;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexUtil;
-import org.eigenbase.sql.fun.SqlStdOperatorTable;
-import org.eigenbase.util.Pair;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.core.JoinRelType;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.util.Pair;
 
 import com.google.common.collect.Lists;
 
@@ -53,7 +53,7 @@ public class DrillJoinRel extends DrillJoinRelBase implements DrillRel {
 
     RexNode remaining = RelOptUtil.splitJoinCondition(left, right, condition, leftKeys, rightKeys);
     if (!remaining.isAlwaysTrue() && (leftKeys.size() == 0 || rightKeys.size() == 0)) {
-      throw new InvalidRelException("DrillJoinRel only supports equi-join");
+      // throw new InvalidRelException("DrillJoinRel only supports equi-join");
     }
   }
 
@@ -68,7 +68,7 @@ public class DrillJoinRel extends DrillJoinRelBase implements DrillRel {
       List<Integer> tmpRightKeys = Lists.newArrayList();
       RexNode remaining = RelOptUtil.splitJoinCondition(left, right, condition, tmpLeftKeys, tmpRightKeys);
       if (!remaining.isAlwaysTrue() && (tmpLeftKeys.size() == 0 || tmpRightKeys.size() == 0)) {
-        throw new InvalidRelException("DrillJoinRel only supports equi-join");
+        // throw new InvalidRelException("DrillJoinRel only supports equi-join");
       }
     }
     this.leftKeys = leftKeys;
@@ -149,8 +149,8 @@ public class DrillJoinRel extends DrillJoinRelBase implements DrillRel {
     // right fields appear after the LHS fields.
     final int rightInputOffset = left.getRowType().getFieldCount();
     for (JoinCondition condition : join.getConditions()) {
-      RelDataTypeField leftField = left.getRowType().getField(ExprHelper.getFieldName(condition.getLeft()), true);
-      RelDataTypeField rightField = right.getRowType().getField(ExprHelper.getFieldName(condition.getRight()), true);
+      RelDataTypeField leftField = left.getRowType().getField(ExprHelper.getFieldName(condition.getLeft()), true, false);
+      RelDataTypeField rightField = right.getRowType().getField(ExprHelper.getFieldName(condition.getRight()), true, false);
         joinConditions.add(
             context.getRexBuilder().makeCall(
                 SqlStdOperatorTable.EQUALS,

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRule.java
index cf15411..f832dfe 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillJoinRule.java
@@ -20,40 +20,40 @@ package org.apache.drill.exec.planner.logical;
 import java.util.List;
 import java.util.logging.Logger;
 
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.JoinRel;
-import org.eigenbase.rel.JoinRelType;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexBuilder;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexUtil;
-import org.eigenbase.sql.fun.SqlStdOperatorTable;
-import org.eigenbase.trace.EigenbaseTrace;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.core.JoinRelType;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.logical.LogicalJoin;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexUtil;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.util.trace.CalciteTrace;
 
 import com.google.common.collect.Lists;
 
 /**
- * Rule that converts a {@link JoinRel} to a {@link DrillJoinRel}, which is implemented by Drill "join" operation.
+ * Rule that converts a {@link org.apache.calcite.rel.logical.LogicalJoin} to a {@link DrillJoinRel}, which is implemented by Drill "join" operation.
  */
 public class DrillJoinRule extends RelOptRule {
   public static final RelOptRule INSTANCE = new DrillJoinRule();
-  protected static final Logger tracer = EigenbaseTrace.getPlannerTracer();
+  protected static final Logger tracer = CalciteTrace.getPlannerTracer();
 
   private DrillJoinRule() {
     super(
-        RelOptHelper.any(JoinRel.class, Convention.NONE),
+        RelOptHelper.any(LogicalJoin.class, Convention.NONE),
         "DrillJoinRule");
   }
 
   @Override
   public void onMatch(RelOptRuleCall call) {
-    final JoinRel join = (JoinRel) call.rel(0);
+    final LogicalJoin join = (LogicalJoin) call.rel(0);
     final RelNode left = join.getLeft();
     final RelNode right = join.getRight();
     final RelTraitSet traits = join.getTraitSet().plus(DrillRel.DRILL_LOGICAL);

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRel.java
index 75a38d8..9faf070 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRel.java
@@ -24,13 +24,13 @@ import org.apache.drill.common.logical.data.Limit;
 import org.apache.drill.common.logical.data.LogicalOperator;
 import org.apache.drill.exec.planner.common.DrillLimitRelBase;
 import org.apache.drill.exec.planner.torel.ConversionContext;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.rex.RexLiteral;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.sql.type.SqlTypeName;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.type.SqlTypeName;
 
 public class DrillLimitRel extends DrillLimitRelBase implements DrillRel {
 
@@ -45,7 +45,7 @@ public class DrillLimitRel extends DrillLimitRelBase implements DrillRel {
 
   @Override
   public LogicalOperator implement(DrillImplementor implementor) {
-    LogicalOperator inputOp = implementor.visitChild(this, 0, getChild());
+    LogicalOperator inputOp = implementor.visitChild(this, 0, getInput());
 
     // First offset to include into results (inclusive). Null implies it is starting from offset 0
     int first = offset != null ? Math.max(0, RexLiteral.intValue(offset)) : 0;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRule.java
index f6c910e..03ef1e8 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillLimitRule.java
@@ -17,34 +17,35 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.SortRel;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Sort;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.logical.LogicalSort;
 
 /**
- * This rule converts a SortRel that has either a offset and fetch into a Drill Sort and LimitPOP Rel
+ * This rule converts a Sort that has either a offset and fetch into a Drill Sort and LimitPOP Rel
  */
 public class DrillLimitRule extends RelOptRule {
   public static DrillLimitRule INSTANCE = new DrillLimitRule();
 
   private DrillLimitRule() {
-    super(RelOptHelper.any(SortRel.class, Convention.NONE), "DrillLimitRule");
+    super(RelOptHelper.any(LogicalSort.class, Convention.NONE), "DrillLimitRule");
   }
 
   @Override
   public boolean matches(RelOptRuleCall call) {
-    final SortRel sort = call.rel(0);
+    final Sort sort = call.rel(0);
     return sort.offset != null || sort.fetch != null;
   }
 
   @Override
   public void onMatch(RelOptRuleCall call) {
-    final SortRel incomingSort = call.rel(0);
+    final Sort incomingSort = call.rel(0);
     final RelTraitSet incomingTraits = incomingSort.getTraitSet();
-    RelNode input = incomingSort.getChild();
+    RelNode input = incomingSort.getInput();
 
     // if the Optiq sort rel includes a collation and a limit, we need to create a copy the sort rel that excludes the
     // limit information.

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeFilterRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeFilterRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeFilterRule.java
index b406cfb..951edcc 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeFilterRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeFilterRule.java
@@ -17,40 +17,45 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.FilterRel;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.rex.RexBuilder;
-import org.eigenbase.rex.RexCall;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexProgram;
-import org.eigenbase.rex.RexProgramBuilder;
-import org.eigenbase.rex.RexUtil;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rel.core.Filter;
+import org.apache.calcite.rel.core.RelFactories;
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexProgram;
+import org.apache.calcite.rex.RexProgramBuilder;
+import org.apache.calcite.rex.RexUtil;
 
 /**
- * MergeFilterRule implements the rule for combining two {@link FilterRel}s
+ * MergeFilterRule implements the rule for combining two {@link Filter}s
  */
 public class DrillMergeFilterRule extends RelOptRule {
-  public static final DrillMergeFilterRule INSTANCE = new DrillMergeFilterRule();
+  public static final DrillMergeFilterRule INSTANCE =
+      new DrillMergeFilterRule(RelFactories.DEFAULT_FILTER_FACTORY);
+
+  private final RelFactories.FilterFactory filterFactory;
+
 
   //~ Constructors -----------------------------------------------------------
 
   /**
    * Creates a MergeFilterRule.
    */
-  private DrillMergeFilterRule() {
+  private DrillMergeFilterRule(RelFactories.FilterFactory filterFactory) {
     super(
-        operand(
-            FilterRel.class,
-            operand(FilterRel.class, any())));
+        operand(Filter.class,
+            operand(Filter.class, any())));
+    this.filterFactory = filterFactory;
   }
 
   //~ Methods ----------------------------------------------------------------
 
   // implement RelOptRule
   public void onMatch(RelOptRuleCall call) {
-    FilterRel topFilter = call.rel(0);
-    FilterRel bottomFilter = call.rel(1);
+    Filter topFilter = call.rel(0);
+    Filter bottomFilter = call.rel(1);
 
     // use RexPrograms to merge the two FilterRels into a single program
     // so we can convert the two FilterRel conditions to directly
@@ -69,27 +74,26 @@ public class DrillMergeFilterRule extends RelOptRule {
         mergedProgram.expandLocalRef(
             mergedProgram.getCondition());
 
-    if(!RexUtil.isFlat(newCondition)){
-      RexCall newCall = (RexCall) newCondition;
-      newCondition = rexBuilder.makeFlatCall( newCall.getOperator(), newCall.getOperands());
-    }
+//    if(!RexUtil.isFlat(newCondition)){
+//      RexCall newCall = (RexCall) newCondition;
+//      newCondition = rexBuilder.makeFlatCall( newCall.getOperator(), newCall.getOperands());
+//    }
 
-    FilterRel newFilterRel =
-        new FilterRel(
-            topFilter.getCluster(),
-            bottomFilter.getChild(),
-            newCondition);
+    Filter newFilterRel =
+        (Filter) filterFactory.createFilter(
+            bottomFilter.getInput(),
+            RexUtil.flatten(rexBuilder, newCondition));
 
     call.transformTo(newFilterRel);
   }
 
   /**
-   * Creates a RexProgram corresponding to a FilterRel
+   * Creates a RexProgram corresponding to a LogicalFilter
    *
-   * @param filterRel the FilterRel
+   * @param filterRel the LogicalFilter
    * @return created RexProgram
    */
-  private RexProgram createProgram(FilterRel filterRel) {
+  private RexProgram createProgram(Filter filterRel) {
     RexProgramBuilder programBuilder =
         new RexProgramBuilder(
             filterRel.getRowType(),

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
index b97d83e..b049277 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillMergeProjectRule.java
@@ -18,15 +18,15 @@
 package org.apache.drill.exec.planner.logical;
 
 
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.rules.ProjectMergeRule;
 import org.apache.drill.exec.expr.fn.FunctionImplementationRegistry;
-import org.eigenbase.rel.ProjectRelBase;
-import org.eigenbase.rel.RelFactories.ProjectFactory;
-import org.eigenbase.rel.rules.MergeProjectRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.rex.RexCall;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.rel.core.RelFactories.ProjectFactory;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexNode;
 
-public class DrillMergeProjectRule extends MergeProjectRule {
+public class DrillMergeProjectRule extends ProjectMergeRule {
 
   private FunctionImplementationRegistry functionRegistry;
   private static DrillMergeProjectRule INSTANCE = null;
@@ -45,8 +45,8 @@ public class DrillMergeProjectRule extends MergeProjectRule {
 
   @Override
   public boolean matches(RelOptRuleCall call) {
-    ProjectRelBase topProject = call.rel(0);
-    ProjectRelBase bottomProject = call.rel(1);
+    Project topProject = call.rel(0);
+    Project bottomProject = call.rel(1);
 
     // We have a complex output type do not fire the merge project rule
     if (checkComplexOutput(topProject) || checkComplexOutput(bottomProject)) {
@@ -56,7 +56,7 @@ public class DrillMergeProjectRule extends MergeProjectRule {
     return true;
   }
 
-  private boolean checkComplexOutput(ProjectRelBase project) {
+  private boolean checkComplexOutput(Project project) {
     for (RexNode expr: project.getChildExps()) {
       if (expr instanceof RexCall) {
         if (functionRegistry.isFunctionComplexOutput(((RexCall) expr).getOperator().getName())) {

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
index b96ff3d..441f2e3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillOptiq.java
@@ -37,23 +37,22 @@ import org.apache.drill.common.types.TypeProtos.MajorType;
 import org.apache.drill.common.types.TypeProtos.MinorType;
 import org.apache.drill.common.types.Types;
 import org.apache.drill.exec.planner.StarColumnHelper;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexCall;
-import org.eigenbase.rex.RexCorrelVariable;
-import org.eigenbase.rex.RexDynamicParam;
-import org.eigenbase.rex.RexFieldAccess;
-import org.eigenbase.rex.RexInputRef;
-import org.eigenbase.rex.RexLiteral;
-import org.eigenbase.rex.RexLocalRef;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexOver;
-import org.eigenbase.rex.RexRangeRef;
-import org.eigenbase.rex.RexVisitorImpl;
-import org.eigenbase.sql.SqlSyntax;
-import org.eigenbase.sql.fun.SqlStdOperatorTable;
-import org.eigenbase.sql.type.SqlTypeName;
-import org.eigenbase.util.NlsString;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexCorrelVariable;
+import org.apache.calcite.rex.RexDynamicParam;
+import org.apache.calcite.rex.RexFieldAccess;
+import org.apache.calcite.rex.RexInputRef;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexLocalRef;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexOver;
+import org.apache.calcite.rex.RexRangeRef;
+import org.apache.calcite.rex.RexVisitorImpl;
+import org.apache.calcite.sql.SqlSyntax;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.util.NlsString;
 
 import com.google.common.collect.Lists;
 
@@ -96,23 +95,7 @@ public class DrillOptiq {
       case BINARY:
         logger.debug("Binary");
         final String funcName = call.getOperator().getName().toLowerCase();
-        List<LogicalExpression> args = Lists.newArrayList();
-        for(RexNode r : call.getOperands()){
-          args.add(r.accept(this));
-        }
-
-        if (FunctionCallFactory.isBooleanOperator(funcName)) {
-          LogicalExpression func = FunctionCallFactory.createBooleanOperator(funcName, args);
-          return func;
-        } else {
-          args = Lists.reverse(args);
-          LogicalExpression lastArg = args.get(0);
-          for(int i = 1; i < args.size(); i++){
-            lastArg = FunctionCallFactory.createExpression(funcName, Lists.newArrayList(args.get(i), lastArg));
-          }
-
-          return lastArg;
-        }
+        return doFunction(call, funcName);
       case FUNCTION:
       case FUNCTION_ID:
         logger.debug("Function");
@@ -190,12 +173,36 @@ public class DrillOptiq {
           }
         }
 
+        if (call.getOperator() == SqlStdOperatorTable.DATETIME_PLUS) {
+          return doFunction(call, "+");
+        }
+
         // fall through
       default:
         throw new AssertionError("todo: implement syntax " + syntax + "(" + call + ")");
       }
     }
 
+    private LogicalExpression doFunction(RexCall call, String funcName) {
+      List<LogicalExpression> args = Lists.newArrayList();
+      for(RexNode r : call.getOperands()){
+        args.add(r.accept(this));
+      }
+
+      if (FunctionCallFactory.isBooleanOperator(funcName)) {
+        LogicalExpression func = FunctionCallFactory.createBooleanOperator(funcName, args);
+        return func;
+      } else {
+        args = Lists.reverse(args);
+        LogicalExpression lastArg = args.get(0);
+        for(int i = 1; i < args.size(); i++){
+          lastArg = FunctionCallFactory.createExpression(funcName, Lists.newArrayList(args.get(i), lastArg));
+        }
+
+        return lastArg;
+      }
+
+    }
     private LogicalExpression doUnknown(Object o){
       logger.warn("Doesn't currently support consumption of {}.", o);
       return NullExpression.INSTANCE;

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRel.java
index 14ea894..26f366e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRel.java
@@ -24,17 +24,16 @@ import org.apache.drill.common.logical.data.NamedExpression;
 import org.apache.drill.common.logical.data.Project;
 import org.apache.drill.exec.planner.common.DrillProjectRelBase;
 import org.apache.drill.exec.planner.torel.ConversionContext;
-import org.eigenbase.rel.InvalidRelException;
-import org.eigenbase.rel.ProjectRelBase;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptCluster;
-import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.reltype.RelDataTypeFieldImpl;
-import org.eigenbase.reltype.RelRecordType;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.sql.type.SqlTypeName;
+import org.apache.calcite.rel.InvalidRelException;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rel.type.RelDataTypeFieldImpl;
+import org.apache.calcite.rel.type.RelRecordType;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.type.SqlTypeName;
 
 import com.google.common.collect.Lists;
 
@@ -49,14 +48,14 @@ public class DrillProjectRel extends DrillProjectRelBase implements DrillRel {
 
 
   @Override
-  public ProjectRelBase copy(RelTraitSet traitSet, RelNode input, List<RexNode> exps, RelDataType rowType) {
+  public org.apache.calcite.rel.core.Project copy(RelTraitSet traitSet, RelNode input, List<RexNode> exps, RelDataType rowType) {
     return new DrillProjectRel(getCluster(), traitSet, input, exps, rowType);
   }
 
 
   @Override
   public LogicalOperator implement(DrillImplementor implementor) {
-    LogicalOperator inputOp = implementor.visitChild(this, 0, getChild());
+    LogicalOperator inputOp = implementor.visitChild(this, 0, getInput());
     Project.Builder builder = Project.builder();
     builder.setInput(inputOp);
     for (NamedExpression e: this.getProjectExpressions(implementor.getContext())) {

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
index 7cef038..e44df33 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillProjectRule.java
@@ -17,27 +17,28 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.ProjectRel;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.Convention;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.logical.LogicalProject;
 
 /**
- * Rule that converts a {@link org.eigenbase.rel.ProjectRel} to a Drill "project" operation.
+ * Rule that converts a {@link org.apache.calcite.rel.logical.LogicalProject} to a Drill "project" operation.
  */
 public class DrillProjectRule extends RelOptRule {
   public static final RelOptRule INSTANCE = new DrillProjectRule();
 
   private DrillProjectRule() {
-    super(RelOptHelper.any(ProjectRel.class, Convention.NONE), "DrillProjectRule");
+    super(RelOptHelper.any(LogicalProject.class, Convention.NONE), "DrillProjectRule");
   }
 
   @Override
   public void onMatch(RelOptRuleCall call) {
-    final ProjectRel project = (ProjectRel) call.rel(0);
-    final RelNode input = project.getChild();
+    final Project project = (Project) call.rel(0);
+    final RelNode input = project.getInput();
     final RelTraitSet traits = project.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
     final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
     call.transformTo(new DrillProjectRel(project.getCluster(), traits, convertedInput, project.getProjects(), project

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
index e2310f7..3755ea1 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushFilterPastProjectRule.java
@@ -19,22 +19,19 @@ package org.apache.drill.exec.planner.logical;
 
 import java.util.List;
 
-import org.apache.drill.common.expression.FieldReference;
-import org.apache.drill.common.expression.SchemaPath;
-import org.eigenbase.rel.CalcRel;
-import org.eigenbase.rel.FilterRel;
-import org.eigenbase.rel.ProjectRel;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelOptUtil;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexCall;
-import org.eigenbase.rex.RexInputRef;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.rex.RexVisitor;
-import org.eigenbase.rex.RexVisitorImpl;
-import org.eigenbase.sql.SqlOperator;
-import org.eigenbase.util.Util;
+import org.apache.calcite.rel.core.Filter;
+import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.logical.LogicalFilter;
+import org.apache.calcite.rel.logical.LogicalProject;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptUtil;
+import org.apache.calcite.rex.RexCall;
+import org.apache.calcite.rex.RexInputRef;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.rex.RexVisitor;
+import org.apache.calcite.rex.RexVisitorImpl;
+import org.apache.calcite.util.Util;
 
 public class DrillPushFilterPastProjectRule extends RelOptRule {
 
@@ -78,16 +75,16 @@ public class DrillPushFilterPastProjectRule extends RelOptRule {
   protected DrillPushFilterPastProjectRule() {
     super(
         operand(
-            FilterRel.class,
-            operand(ProjectRel.class, any())));
+            LogicalFilter.class,
+            operand(LogicalProject.class, any())));
   }
 
   //~ Methods ----------------------------------------------------------------
 
   // implement RelOptRule
   public void onMatch(RelOptRuleCall call) {
-    FilterRel filterRel = call.rel(0);
-    ProjectRel projRel = call.rel(1);
+    Filter filterRel = call.rel(0);
+    Project projRel = call.rel(1);
 
     // Don't push Filter past Project if the Filter is referencing an ITEM expression
     // from the Project.
@@ -101,15 +98,10 @@ public class DrillPushFilterPastProjectRule extends RelOptRule {
     RexNode newCondition =
         RelOptUtil.pushFilterPastProject(filterRel.getCondition(), projRel);
 
-    FilterRel newFilterRel =
-        new FilterRel(
-            filterRel.getCluster(),
-            projRel.getChild(),
-            newCondition);
+    Filter newFilterRel = LogicalFilter.create(projRel.getInput(), newCondition);
 
-
-    ProjectRel newProjRel =
-        (ProjectRel) CalcRel.createProject(
+    Project newProjRel =
+        (Project) RelOptUtil.createProject(
             newFilterRel,
             projRel.getNamedProjects(),
             false);

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushPartitionFilterIntoScan.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushPartitionFilterIntoScan.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushPartitionFilterIntoScan.java
index c6dceda..b83cedd 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushPartitionFilterIntoScan.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushPartitionFilterIntoScan.java
@@ -29,10 +29,9 @@ import org.apache.drill.exec.planner.physical.PlannerSettings;
 import org.apache.drill.exec.planner.physical.PrelUtil;
 import org.apache.drill.exec.store.dfs.FileSelection;
 import org.apache.drill.exec.store.dfs.FormatSelection;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelOptRuleOperand;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.plan.RelOptRule;
+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/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjIntoScan.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjIntoScan.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjIntoScan.java
index fcfced2..379f6e9 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjIntoScan.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjIntoScan.java
@@ -21,19 +21,16 @@ package org.apache.drill.exec.planner.logical;
 import java.io.IOException;
 import java.util.List;
 
-import net.hydromatic.optiq.rules.java.JavaRules.EnumerableTableAccessRel;
-
+import org.apache.calcite.adapter.enumerable.EnumerableTableScan;
+import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.logical.LogicalProject;
+import org.apache.calcite.rel.rules.ProjectRemoveRule;
 import org.apache.drill.common.exceptions.DrillRuntimeException;
 import org.apache.drill.exec.planner.physical.PrelUtil;
 import org.apache.drill.exec.planner.physical.PrelUtil.ProjectPushInfo;
-import org.eigenbase.rel.ProjectRel;
-import org.eigenbase.rel.ProjectRelBase;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.rules.PushProjector;
-import org.eigenbase.rel.rules.RemoveTrivialProjectRule;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.rex.RexNode;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.rex.RexNode;
 
 import com.google.common.collect.Lists;
 
@@ -41,14 +38,14 @@ public class DrillPushProjIntoScan extends RelOptRule {
   public static final RelOptRule INSTANCE = new DrillPushProjIntoScan();
 
   private DrillPushProjIntoScan() {
-    super(RelOptHelper.some(ProjectRel.class, RelOptHelper.any(EnumerableTableAccessRel.class)), "DrillPushProjIntoScan");
+    super(RelOptHelper.some(LogicalProject.class, RelOptHelper.any(EnumerableTableScan.class)), "DrillPushProjIntoScan");
   }
 
 
   @Override
   public void onMatch(RelOptRuleCall call) {
-    final ProjectRel proj = (ProjectRel) call.rel(0);
-    final EnumerableTableAccessRel scan = (EnumerableTableAccessRel) call.rel(1);
+    final Project proj = (Project) call.rel(0);
+    final EnumerableTableScan scan = (EnumerableTableScan) call.rel(1);
 
     try {
       ProjectPushInfo columnInfo = PrelUtil.getColumns(scan.getRowType(), proj.getProjects());
@@ -63,7 +60,7 @@ public class DrillPushProjIntoScan extends RelOptRule {
           new DrillScanRel(scan.getCluster(),
               scan.getTraitSet().plus(DrillRel.DRILL_LOGICAL),
               scan.getTable(),
-              columnInfo.createNewRowType(proj.getChild().getCluster().getTypeFactory()),
+              columnInfo.createNewRowType(proj.getInput().getCluster().getTypeFactory()),
               columnInfo.columns);
 
 
@@ -79,7 +76,7 @@ public class DrillPushProjIntoScan extends RelOptRule {
               newProjects,
               proj.getRowType());
 
-      if (RemoveTrivialProjectRule.isTrivial(newProj)) {
+      if (ProjectRemoveRule.isTrivial(newProj)) {
         call.transformTo(newScan);
       } else {
         call.transformTo(newProj);

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastFilterRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastFilterRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastFilterRule.java
index 29e6559..4f950d3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastFilterRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastFilterRule.java
@@ -17,11 +17,11 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.rules.PushProjectPastFilterRule;
-import org.eigenbase.rel.rules.PushProjector;
-import org.eigenbase.relopt.RelOptRule;
+import org.apache.calcite.rel.rules.ProjectFilterTransposeRule;
+import org.apache.calcite.rel.rules.PushProjector;
+import org.apache.calcite.plan.RelOptRule;
 
-public class DrillPushProjectPastFilterRule extends PushProjectPastFilterRule {
+public class DrillPushProjectPastFilterRule extends ProjectFilterTransposeRule {
 
   public final static RelOptRule INSTANCE = new DrillPushProjectPastFilterRule(DrillConditions.PRESERVE_ITEM);
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastJoinRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastJoinRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastJoinRule.java
index 7296d08..e27360f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastJoinRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillPushProjectPastJoinRule.java
@@ -17,11 +17,11 @@
  */
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.rules.PushProjectPastJoinRule;
-import org.eigenbase.rel.rules.PushProjector;
-import org.eigenbase.relopt.RelOptRule;
+import org.apache.calcite.rel.rules.ProjectJoinTransposeRule;
+import org.apache.calcite.rel.rules.PushProjector;
+import org.apache.calcite.plan.RelOptRule;
 
-public class DrillPushProjectPastJoinRule extends PushProjectPastJoinRule {
+public class DrillPushProjectPastJoinRule extends ProjectJoinTransposeRule {
 
   public static final RelOptRule INSTANCE = new DrillPushProjectPastJoinRule(DrillConditions.PRESERVE_ITEM);
 

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceAggregatesRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceAggregatesRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceAggregatesRule.java
index 9832406..9ba01a8 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceAggregatesRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceAggregatesRule.java
@@ -26,31 +26,32 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import com.google.common.collect.Lists;
+import org.apache.calcite.rel.core.Aggregate;
+import org.apache.calcite.rel.logical.LogicalAggregate;
+import org.apache.calcite.sql.fun.SqlCountAggFunction;
+import org.apache.calcite.sql.type.SqlTypeName;
 import org.apache.drill.exec.planner.sql.DrillSqlOperator;
-import org.eigenbase.rel.AggregateCall;
-import org.eigenbase.rel.AggregateRel;
-import org.eigenbase.rel.AggregateRelBase;
-import org.eigenbase.rel.CalcRel;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.relopt.RelOptRule;
-import org.eigenbase.relopt.RelOptRuleCall;
-import org.eigenbase.relopt.RelOptRuleOperand;
-import org.eigenbase.reltype.RelDataType;
-import org.eigenbase.reltype.RelDataTypeFactory;
-import org.eigenbase.reltype.RelDataTypeField;
-import org.eigenbase.rex.RexBuilder;
-import org.eigenbase.rex.RexLiteral;
-import org.eigenbase.rex.RexNode;
-import org.eigenbase.sql.SqlAggFunction;
-import org.eigenbase.sql.fun.SqlAvgAggFunction;
-import org.eigenbase.sql.fun.SqlStdOperatorTable;
-import org.eigenbase.sql.fun.SqlSumAggFunction;
-import org.eigenbase.sql.fun.SqlSumEmptyIsZeroAggFunction;
-import org.eigenbase.sql.type.SqlTypeName;
-import org.eigenbase.util.CompositeList;
-import org.eigenbase.util.ImmutableIntList;
-import org.eigenbase.util.Util;
+import org.apache.calcite.rel.core.AggregateCall;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.plan.RelOptRule;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.calcite.plan.RelOptRuleOperand;
+import org.apache.calcite.plan.RelOptUtil;
+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.rex.RexBuilder;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.SqlAggFunction;
+import org.apache.calcite.sql.fun.SqlAvgAggFunction;
+import org.apache.calcite.sql.fun.SqlStdOperatorTable;
+import org.apache.calcite.sql.fun.SqlSumAggFunction;
+import org.apache.calcite.sql.fun.SqlSumEmptyIsZeroAggFunction;
+import org.apache.calcite.sql.type.SqlTypeUtil;
+import org.apache.calcite.util.CompositeList;
+import org.apache.calcite.util.ImmutableIntList;
+import org.apache.calcite.util.Util;
 
 import com.google.common.collect.ImmutableList;
 
@@ -65,7 +66,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
    * The singleton.
    */
   public static final DrillReduceAggregatesRule INSTANCE =
-      new DrillReduceAggregatesRule(operand(AggregateRel.class, any()));
+      new DrillReduceAggregatesRule(operand(LogicalAggregate.class, any()));
 
   private static final DrillSqlOperator CastHighOp = new DrillSqlOperator("CastHigh", 1, false);
 
@@ -82,13 +83,13 @@ public class DrillReduceAggregatesRule extends RelOptRule {
     if (!super.matches(call)) {
       return false;
     }
-    AggregateRelBase oldAggRel = (AggregateRelBase) call.rels[0];
+    Aggregate oldAggRel = (Aggregate) call.rels[0];
     return containsAvgStddevVarCall(oldAggRel.getAggCallList());
   }
 
   @Override
   public void onMatch(RelOptRuleCall ruleCall) {
-    AggregateRelBase oldAggRel = (AggregateRelBase) ruleCall.rels[0];
+    Aggregate oldAggRel = (Aggregate) ruleCall.rels[0];
     reduceAggs(ruleCall, oldAggRel);
   }
 
@@ -127,7 +128,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
    */
   private void reduceAggs(
       RelOptRuleCall ruleCall,
-      AggregateRelBase oldAggRel) {
+      Aggregate oldAggRel) {
     RexBuilder rexBuilder = oldAggRel.getCluster().getRexBuilder();
 
     List<AggregateCall> oldCalls = oldAggRel.getAggCallList();
@@ -150,7 +151,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
     // List of input expressions. If a particular aggregate needs more, it
     // will add an expression to the end, and we will create an extra
     // project.
-    RelNode input = oldAggRel.getChild();
+    RelNode input = oldAggRel.getInput();
     List<RexNode> inputExprs = new ArrayList<RexNode>();
     for (RelDataTypeField field : input.getRowType().getFieldList()) {
       inputExprs.add(
@@ -169,7 +170,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         inputExprs.size() - input.getRowType().getFieldCount();
     if (extraArgCount > 0) {
       input =
-          CalcRel.createProject(
+          RelOptUtil.createProject(
               input,
               inputExprs,
               CompositeList.of(
@@ -178,12 +179,12 @@ public class DrillReduceAggregatesRule extends RelOptRule {
                       extraArgCount,
                       null)));
     }
-    AggregateRelBase newAggRel =
+    Aggregate newAggRel =
         newAggregateRel(
             oldAggRel, input, newCalls);
 
     RelNode projectRel =
-        CalcRel.createProject(
+        RelOptUtil.createProject(
             newAggRel,
             projList,
             oldAggRel.getRowType().getFieldNames());
@@ -192,7 +193,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
   }
 
   private RexNode reduceAgg(
-      AggregateRelBase oldAggRel,
+      Aggregate oldAggRel,
       AggregateCall oldCall,
       List<AggregateCall> newCalls,
       Map<AggregateCall, RexNode> aggCallMapping,
@@ -261,6 +262,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
       return rexBuilder.addAggCall(
           oldCall,
           nGroups,
+          oldAggRel.indicator,
           newCalls,
           aggCallMapping,
           oldArgTypes);
@@ -268,7 +270,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
   }
 
   private RexNode reduceAvg(
-      AggregateRelBase oldAggRel,
+      Aggregate oldAggRel,
       AggregateCall oldCall,
       List<AggregateCall> newCalls,
       Map<AggregateCall, RexNode> aggCallMapping) {
@@ -279,14 +281,14 @@ public class DrillReduceAggregatesRule extends RelOptRule {
     int iAvgInput = oldCall.getArgList().get(0);
     RelDataType avgInputType =
         getFieldType(
-            oldAggRel.getChild(),
+            oldAggRel.getInput(),
             iAvgInput);
     RelDataType sumType =
         typeFactory.createTypeWithNullability(
             avgInputType,
             avgInputType.isNullable() || nGroups == 0);
     // SqlAggFunction sumAgg = new SqlSumAggFunction(sumType);
-    SqlAggFunction sumAgg = new SqlSumEmptyIsZeroAggFunction(sumType);
+    SqlAggFunction sumAgg = new SqlSumEmptyIsZeroAggFunction();
     AggregateCall sumCall =
         new AggregateCall(
             sumAgg,
@@ -294,8 +296,8 @@ public class DrillReduceAggregatesRule extends RelOptRule {
             oldCall.getArgList(),
             sumType,
             null);
-    SqlAggFunction countAgg = SqlStdOperatorTable.COUNT;
-    RelDataType countType = countAgg.getReturnType(typeFactory);
+    final SqlCountAggFunction countAgg = (SqlCountAggFunction) SqlStdOperatorTable.COUNT;
+    final RelDataType countType = countAgg.getReturnType(typeFactory);
     AggregateCall countCall =
         new AggregateCall(
             countAgg,
@@ -308,6 +310,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             sumCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(avgInputType));
@@ -316,6 +319,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             countCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(avgInputType));
@@ -345,6 +349,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             countCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(avgInputType));
@@ -358,7 +363,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
   }
 
   private RexNode reduceSum(
-      AggregateRelBase oldAggRel,
+      Aggregate oldAggRel,
       AggregateCall oldCall,
       List<AggregateCall> newCalls,
       Map<AggregateCall, RexNode> aggCallMapping) {
@@ -369,12 +374,12 @@ public class DrillReduceAggregatesRule extends RelOptRule {
     int arg = oldCall.getArgList().get(0);
     RelDataType argType =
         getFieldType(
-            oldAggRel.getChild(),
+            oldAggRel.getInput(),
             arg);
     RelDataType sumType =
         typeFactory.createTypeWithNullability(
             argType, argType.isNullable());
-    SqlAggFunction sumZeroAgg = new SqlSumEmptyIsZeroAggFunction(sumType);
+    SqlAggFunction sumZeroAgg = new SqlSumEmptyIsZeroAggFunction();
     AggregateCall sumZeroCall =
         new AggregateCall(
             sumZeroAgg,
@@ -382,8 +387,8 @@ public class DrillReduceAggregatesRule extends RelOptRule {
             oldCall.getArgList(),
             sumType,
             null);
-    SqlAggFunction countAgg = SqlStdOperatorTable.COUNT;
-    RelDataType countType = countAgg.getReturnType(typeFactory);
+    final SqlCountAggFunction countAgg = (SqlCountAggFunction) SqlStdOperatorTable.COUNT;
+    final RelDataType countType = countAgg.getReturnType(typeFactory);
     AggregateCall countCall =
         new AggregateCall(
             countAgg,
@@ -398,6 +403,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             sumZeroCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(argType));
@@ -411,6 +417,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             countCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(argType));
@@ -422,7 +429,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
   }
 
   private RexNode reduceStddev(
-      AggregateRelBase oldAggRel,
+      Aggregate oldAggRel,
       AggregateCall oldCall,
       boolean biased,
       boolean sqrt,
@@ -449,7 +456,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
     final int argOrdinal = oldCall.getArgList().get(0);
     final RelDataType argType =
         getFieldType(
-            oldAggRel.getChild(),
+            oldAggRel.getInput(),
             argOrdinal);
 
     // final RexNode argRef = inputExprs.get(argOrdinal);
@@ -476,6 +483,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             sumArgSquaredAggCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(argType));
@@ -491,6 +499,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
           rexBuilder.addAggCall(
               sumArgAggCall,
               nGroups,
+              oldAggRel.indicator,
               newCalls,
               aggCallMapping,
               ImmutableList.of(argType));
@@ -499,7 +508,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
           rexBuilder.makeCall(
               SqlStdOperatorTable.MULTIPLY, sumArg, sumArg);
 
-    final SqlAggFunction countAgg = SqlStdOperatorTable.COUNT;
+    final SqlCountAggFunction countAgg = (SqlCountAggFunction) SqlStdOperatorTable.COUNT;
     final RelDataType countType = countAgg.getReturnType(typeFactory);
     final AggregateCall countArgAggCall =
         new AggregateCall(
@@ -512,6 +521,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
         rexBuilder.addAggCall(
             countArgAggCall,
             nGroups,
+            oldAggRel.indicator,
             newCalls,
             aggCallMapping,
             ImmutableList.of(argType));
@@ -590,7 +600,7 @@ public class DrillReduceAggregatesRule extends RelOptRule {
 
   /**
    * Do a shallow clone of oldAggRel and update aggCalls. Could be refactored
-   * into AggregateRelBase and subclasses - but it's only needed for some
+   * into Aggregate and subclasses - but it's only needed for some
    * subclasses.
    *
    * @param oldAggRel AggregateRel to clone.
@@ -598,15 +608,11 @@ public class DrillReduceAggregatesRule extends RelOptRule {
    * @param newCalls  New list of AggregateCalls
    * @return shallow clone with new list of AggregateCalls.
    */
-  protected AggregateRelBase newAggregateRel(
-      AggregateRelBase oldAggRel,
+  protected Aggregate newAggregateRel(
+      Aggregate oldAggRel,
       RelNode inputRel,
       List<AggregateCall> newCalls) {
-    return new AggregateRel(
-        oldAggRel.getCluster(),
-        inputRel,
-        oldAggRel.getGroupSet(),
-        newCalls);
+    return LogicalAggregate.create(inputRel, oldAggRel.indicator, oldAggRel.getGroupSet(), oldAggRel.getGroupSets(), newCalls);
   }
 
   private RelDataType getFieldType(RelNode relNode, int i) {

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceExpressionsRule.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceExpressionsRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceExpressionsRule.java
index 29175e5..3527601 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceExpressionsRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillReduceExpressionsRule.java
@@ -17,13 +17,15 @@
  ******************************************************************************/
 package org.apache.drill.exec.planner.logical;
 
-import org.eigenbase.rel.CalcRel;
-import org.eigenbase.rel.FilterRel;
-import org.eigenbase.rel.RelCollationImpl;
-import org.eigenbase.rel.RelNode;
-import org.eigenbase.rel.SingleRel;
-import org.eigenbase.rel.SortRel;
-import org.eigenbase.rel.rules.ReduceExpressionsRule;
+import org.apache.calcite.rel.core.Calc;
+import org.apache.calcite.rel.logical.LogicalCalc;
+import org.apache.calcite.rel.core.Filter;
+import org.apache.calcite.rel.RelCollationImpl;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.SingleRel;
+import org.apache.calcite.rel.core.Sort;
+import org.apache.calcite.rel.logical.LogicalSort;
+import org.apache.calcite.rel.rules.ReduceExpressionsRule;
 
 import java.math.BigDecimal;
 
@@ -48,7 +50,7 @@ public class DrillReduceExpressionsRule {
      * expose the planning time known schema. Instead we have to insert a limit 0.
      */
     @Override
-    protected RelNode createEmptyRelOrEquivalent(FilterRel filter) {
+    protected RelNode createEmptyRelOrEquivalent(Filter filter) {
       return createEmptyEmptyRelHelper(filter);
     }
 
@@ -67,16 +69,14 @@ public class DrillReduceExpressionsRule {
      * expose the planning time known schema. Instead we have to insert a limit 0.
      */
     @Override
-    protected RelNode createEmptyRelOrEquivalent(CalcRel calc) {
+    protected RelNode createEmptyRelOrEquivalent(Calc calc) {
       return createEmptyEmptyRelHelper(calc);
     }
 
   }
 
   private static RelNode createEmptyEmptyRelHelper(SingleRel input) {
-    return new SortRel(input.getCluster(), input.getTraitSet(),
-        input.getChild(),
-        RelCollationImpl.EMPTY,
+    return LogicalSort.create(input.getInput(), RelCollationImpl.EMPTY,
         input.getCluster().getRexBuilder().makeExactLiteral(BigDecimal.valueOf(0)),
         input.getCluster().getRexBuilder().makeExactLiteral(BigDecimal.valueOf(0)));
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/581f2e84/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java
index 7ed7885..9996dfb 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillRel.java
@@ -19,7 +19,7 @@ package org.apache.drill.exec.planner.logical;
 
 import org.apache.drill.common.logical.data.LogicalOperator;
 import org.apache.drill.exec.planner.common.DrillRelNode;
-import org.eigenbase.relopt.Convention;
+import org.apache.calcite.plan.Convention;
 
 /**
  * Relational expression that is implemented in Drill.


Mime
View raw message