public class DrillRelMdDistinctRowCount
extends org.apache.calcite.rel.metadata.RelMdDistinctRowCount
Modifier and Type | Field and Description |
---|---|
static org.apache.calcite.rel.metadata.RelMetadataProvider |
SOURCE |
Constructor and Description |
---|
DrillRelMdDistinctRowCount() |
Modifier and Type | Method and Description |
---|---|
Double |
getDistinctRowCount(org.apache.calcite.rel.core.Join rel,
org.apache.calcite.rel.metadata.RelMetadataQuery mq,
org.apache.calcite.util.ImmutableBitSet groupKey,
org.apache.calcite.rex.RexNode predicate)
We need to override this method since Calcite and Drill calculate
joined row count in different ways.
|
Double |
getDistinctRowCount(org.apache.calcite.rel.RelNode rel,
org.apache.calcite.rel.metadata.RelMetadataQuery mq,
org.apache.calcite.util.ImmutableBitSet groupKey,
org.apache.calcite.rex.RexNode predicate) |
Double |
getDistinctRowCount(org.apache.calcite.plan.volcano.RelSubset rel,
org.apache.calcite.rel.metadata.RelMetadataQuery mq,
org.apache.calcite.util.ImmutableBitSet groupKey,
org.apache.calcite.rex.RexNode predicate) |
public Double getDistinctRowCount(org.apache.calcite.rel.core.Join rel, org.apache.calcite.rel.metadata.RelMetadataQuery mq, org.apache.calcite.util.ImmutableBitSet groupKey, org.apache.calcite.rex.RexNode predicate)
RelMdDistinctRowCount.getDistinctRowCount(Join, RelMetadataQuery,
ImmutableBitSet, RexNode)
method is used and after that used
another getDistinctRowCount method for parent rel, which just uses
row count of input rel node (our join rel).
It causes cost increase of best rel node when
RelSubset.propagateCostImprovements(org.apache.calcite.plan.volcano.VolcanoPlanner, org.apache.calcite.rel.metadata.RelMetadataQuery, org.apache.calcite.rel.RelNode, java.util.Set<org.apache.calcite.plan.volcano.RelSubset>)
is called.
This is a part of the fix for CALCITE-2018.getDistinctRowCount
in class org.apache.calcite.rel.metadata.RelMdDistinctRowCount
public Double getDistinctRowCount(org.apache.calcite.rel.RelNode rel, org.apache.calcite.rel.metadata.RelMetadataQuery mq, org.apache.calcite.util.ImmutableBitSet groupKey, org.apache.calcite.rex.RexNode predicate)
getDistinctRowCount
in class org.apache.calcite.rel.metadata.RelMdDistinctRowCount
public Double getDistinctRowCount(org.apache.calcite.plan.volcano.RelSubset rel, org.apache.calcite.rel.metadata.RelMetadataQuery mq, org.apache.calcite.util.ImmutableBitSet groupKey, org.apache.calcite.rex.RexNode predicate)
getDistinctRowCount
in class org.apache.calcite.rel.metadata.RelMdDistinctRowCount
Copyright © 1970 The Apache Software Foundation. All rights reserved.