aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java
diff options
context:
space:
mode:
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java
index 8a46f86b7..760a6ba5b 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ScanPrel.java
@@ -21,26 +21,25 @@ import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelWriter;
import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.rel.type.RelDataType;
import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.exec.physical.base.GroupScan;
import org.apache.drill.exec.physical.base.PhysicalOperator;
import org.apache.drill.exec.physical.base.ScanStats;
+import org.apache.drill.exec.planner.common.DrillScanRelBase;
import org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory;
import org.apache.drill.exec.planner.fragment.DistributionAffinity;
import org.apache.drill.exec.planner.physical.visitor.PrelVisitor;
import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode;
-import org.apache.drill.exec.planner.common.DrillScanRelBase;
-import org.apache.calcite.rel.RelNode;
-import org.apache.calcite.rel.RelWriter;
-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.plan.RelOptTable;
-import org.apache.calcite.rel.type.RelDataType;
public class ScanPrel extends DrillScanRelBase implements Prel, HasDistributionAffinity {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory
@@ -80,6 +79,12 @@ public class ScanPrel extends DrillScanRelBase implements Prel, HasDistributionA
return creator.addMetadata(this, this.getGroupScan());
}
+ public static ScanPrel create(RelNode old, RelTraitSet traitSets,
+ GroupScan scan, RelDataType rowType) {
+ return new ScanPrel(old.getCluster(), traitSets,
+ getCopy(scan), rowType, old.getTable());
+ }
+
@Override
public RelWriter explainTerms(RelWriter pw) {
return super.explainTerms(pw).item("groupscan", this.getGroupScan().getDigest());
@@ -110,8 +115,8 @@ public class ScanPrel extends DrillScanRelBase implements Prel, HasDistributionA
return planner.getCostFactory().makeCost(stats.getRecordCount() * columnCount, stats.getCpuCost(), stats.getDiskCost());
}
- // double rowCount = RelMetadataQuery.getRowCount(this);
- double rowCount = stats.getRecordCount();
+ double rowCount = mq.getRowCount(this);
+ //double rowCount = stats.getRecordCount();
// As DRILL-4083 points out, when columnCount == 0, cpuCost becomes zero,
// which makes the costs of HiveScan and HiveDrillNativeParquetScan the same