This is an automated email from the ASF dual-hosted git repository.

volodymyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d33c5b8b0 DRILL-8213: Replace deprecated RelNode.getRows with 
RelNode.estimateRowCount
9d33c5b8b0 is described below

commit 9d33c5b8b0a382272989965509823752614a9682
Author: Volodymyr Vysotskyi <[email protected]>
AuthorDate: Sat May 7 19:29:41 2022 +0300

    DRILL-8213: Replace deprecated RelNode.getRows with RelNode.estimateRowCount
---
 .../java/org/apache/drill/exec/planner/cost/DrillRelMdRowCount.java | 2 +-
 .../exec/planner/index/generators/IndexIntersectPlanGenerator.java  | 4 +++-
 .../drill/exec/planner/physical/RangePartitionExchangePrel.java     | 2 +-
 .../java/org/apache/drill/exec/planner/physical/RowKeyJoinPrel.java | 6 +++---
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdRowCount.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdRowCount.java
index 0bfb70ae90..eaaf7d1158 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdRowCount.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/cost/DrillRelMdRowCount.java
@@ -87,7 +87,7 @@ public class DrillRelMdRowCount extends RelMdRowCount{
   @Override
   public Double getRowCount(Filter rel, RelMetadataQuery mq) {
     // Need capped selectivity estimates. See the Filter getRows() method
-    return rel.getRows();
+    return rel.estimateRowCount(mq);
   }
 
   @Override
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/index/generators/IndexIntersectPlanGenerator.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/index/generators/IndexIntersectPlanGenerator.java
index 11d73589d0..2d17586a46 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/index/generators/IndexIntersectPlanGenerator.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/index/generators/IndexIntersectPlanGenerator.java
@@ -17,6 +17,7 @@
  */
 package org.apache.drill.exec.planner.index.generators;
 
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
 import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList;
 import org.apache.drill.shaded.guava.com.google.common.collect.Lists;
 import org.apache.drill.shaded.guava.com.google.common.collect.Maps;
@@ -204,10 +205,11 @@ public class IndexIntersectPlanGenerator extends 
AbstractIndexPlanGenerator {
         indexFilterPrel, indexProjectExprs, indexProjectRowType);
 
     RelTraitSet rightSideTraits = newTraitSet().plus(Prel.DRILL_PHYSICAL);
+    RelMetadataQuery mq = indexProjectPrel.getCluster().getMetadataQuery();
     // if build(right) side does not exist, this index scan is the right most.
     if (right == null) {
       if (partition == DrillDistributionTrait.RANDOM_DISTRIBUTED &&
-          settings.getSliceTarget() < indexProjectPrel.getRows()) {
+          settings.getSliceTarget() < indexProjectPrel.estimateRowCount(mq)) {
         final DrillDistributionTrait distRight =
             new DrillDistributionTrait(DistributionType.BROADCAST_DISTRIBUTED);
         rightSideTraits = newTraitSet(distRight).plus(Prel.DRILL_PHYSICAL);
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RangePartitionExchangePrel.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RangePartitionExchangePrel.java
index 76568c05d3..3f8c4fea6c 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RangePartitionExchangePrel.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RangePartitionExchangePrel.java
@@ -63,7 +63,7 @@ public class RangePartitionExchangePrel extends ExchangePrel {
   @Override
   public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery 
mq) {
     if (PrelUtil.getSettings(getCluster()).useDefaultCosting()) {
-      return super.computeSelfCost(planner).multiplyBy(.1);
+      return super.computeSelfCost(planner, mq).multiplyBy(.1);
     }
     RelNode child = this.getInput();
     double inputRows = (mq == null)? ROWCOUNT_UNKNOWN : mq.getRowCount(child);
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RowKeyJoinPrel.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RowKeyJoinPrel.java
index 54c2230746..eb9834cabd 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RowKeyJoinPrel.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/RowKeyJoinPrel.java
@@ -42,7 +42,7 @@ public class RowKeyJoinPrel extends JoinPrel implements Prel {
 
   double estimatedRowCount = -1;
   public RowKeyJoinPrel(RelOptCluster cluster, RelTraitSet traits, RelNode 
left, RelNode right,
-      RexNode condition, JoinRelType joinType) throws InvalidRelException {
+      RexNode condition, JoinRelType joinType) {
     super(cluster, traits, left, right, condition, joinType);
     Preconditions.checkArgument(joinType == JoinRelType.INNER);
   }
@@ -66,7 +66,7 @@ public class RowKeyJoinPrel extends JoinPrel implements Prel {
     if (estimatedRowCount >= 0) {
       return estimatedRowCount;
     }
-    return this.getLeft().getRows();
+    return getLeft().estimateRowCount(mq);
   }
 
   @Override
@@ -85,7 +85,7 @@ public class RowKeyJoinPrel extends JoinPrel implements Prel {
   @Override
   public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery 
mq) {
     if(PrelUtil.getSettings(getCluster()).useDefaultCosting()) {
-      return super.computeSelfCost(planner).multiplyBy(.1);
+      return super.computeSelfCost(planner, mq).multiplyBy(.1);
     }
     double rowCount = mq.getRowCount(this.getRight());
     DrillCostFactory costFactory = (DrillCostFactory) planner.getCostFactory();

Reply via email to