public class FlinkRelMetadataQuery
extends org.apache.calcite.rel.metadata.RelMetadataQuery
Modifier and Type | Method and Description |
---|---|
org.apache.flink.table.planner.plan.trait.FlinkRelDistribution |
flinkDistribution(org.apache.calcite.rel.RelNode rel)
Returns the
FlinkRelDistribution statistic. |
org.apache.flink.table.planner.plan.stats.ValueInterval |
getColumnInterval(org.apache.calcite.rel.RelNode rel,
int index)
Returns the
FlinkMetadata.ColumnInterval statistic. |
Double |
getColumnNullCount(org.apache.calcite.rel.RelNode rel,
int index)
Returns the null count of the given column.
|
Double |
getColumnOriginNullCount(org.apache.calcite.rel.RelNode rel,
int index)
Returns origin null count of the given column.
|
org.apache.flink.table.planner.plan.stats.ValueInterval |
getFilteredColumnInterval(org.apache.calcite.rel.RelNode rel,
int columnIndex,
int filterArg)
Returns the
FlinkMetadata.ColumnInterval of the given column under the given filter
argument. |
org.apache.flink.table.planner.plan.trait.RelModifiedMonotonicity |
getRelModifiedMonotonicity(org.apache.calcite.rel.RelNode rel)
Returns the
RelModifiedMonotonicity statistic. |
RelWindowProperties |
getRelWindowProperties(org.apache.calcite.rel.RelNode rel)
Returns the
RelWindowProperties statistic. |
org.apache.calcite.util.ImmutableBitSet |
getUniqueGroups(org.apache.calcite.rel.RelNode rel,
org.apache.calcite.util.ImmutableBitSet columns)
Returns the (minimum) unique groups of the given columns.
|
Set<org.apache.calcite.util.ImmutableBitSet> |
getUpsertKeys(org.apache.calcite.rel.RelNode rel)
Determines the set of upsert minimal keys for this expression.
|
Set<org.apache.calcite.util.ImmutableBitSet> |
getUpsertKeysInKeyGroupRange(org.apache.calcite.rel.RelNode rel,
int[] partitionKeys)
Determines the set of upsert minimal keys in a single key group range, which means can ignore
exchange by partition keys.
|
static FlinkRelMetadataQuery |
instance()
Returns an instance of FlinkRelMetadataQuery.
|
static FlinkRelMetadataQuery |
reuseOrCreate(org.apache.calcite.rel.metadata.RelMetadataQuery mq)
Reuse input metadataQuery instance if it could cast to FlinkRelMetadataQuery class, or create
one if not.
|
areColumnsUnique, areColumnsUnique, areRowsUnique, areRowsUnique, collations, cumulativeMemoryWithinPhase, cumulativeMemoryWithinPhaseSplit, distribution, getAllPredicates, getAverageColumnSizes, getAverageColumnSizesNotNull, getAverageRowSize, getColumnOrigin, getColumnOrigins, getCumulativeCost, getDistinctRowCount, getDistribution, getExpressionLineage, getLowerBoundCost, getMaxRowCount, getMinRowCount, getNodeTypes, getNonCumulativeCost, getPercentageOriginalRows, getPopulationSize, getPulledUpPredicates, getRowCount, getSelectivity, getTableOrigin, getTableReferences, getUniqueKeys, getUniqueKeys, isPhaseTransition, isVisibleInExplain, memory, splitCount
public static FlinkRelMetadataQuery instance()
public static FlinkRelMetadataQuery reuseOrCreate(org.apache.calcite.rel.metadata.RelMetadataQuery mq)
mq
- metadataQuery which try to reusepublic org.apache.flink.table.planner.plan.stats.ValueInterval getColumnInterval(org.apache.calcite.rel.RelNode rel, int index)
FlinkMetadata.ColumnInterval
statistic.rel
- the relational expressionindex
- the index of the given columnEmptyValueInterval
if column values does not
contains any value except for null.public org.apache.flink.table.planner.plan.stats.ValueInterval getFilteredColumnInterval(org.apache.calcite.rel.RelNode rel, int columnIndex, int filterArg)
FlinkMetadata.ColumnInterval
of the given column under the given filter
argument.rel
- the relational expressioncolumnIndex
- the index of the given columnfilterArg
- the index of the filter argumentEmptyValueInterval
if column values does not
contains any value except for null.public Double getColumnNullCount(org.apache.calcite.rel.RelNode rel, int index)
rel
- the relational expressionindex
- the index of the given columnpublic Double getColumnOriginNullCount(org.apache.calcite.rel.RelNode rel, int index)
rel
- the relational expressionindex
- the index of the given columnpublic org.apache.calcite.util.ImmutableBitSet getUniqueGroups(org.apache.calcite.rel.RelNode rel, org.apache.calcite.util.ImmutableBitSet columns)
rel
- the relational expressioncolumns
- the given columns in a specified relational expression. The given columns
should not be null.public org.apache.flink.table.planner.plan.trait.FlinkRelDistribution flinkDistribution(org.apache.calcite.rel.RelNode rel)
FlinkRelDistribution
statistic.rel
- the relational expressionpublic org.apache.flink.table.planner.plan.trait.RelModifiedMonotonicity getRelModifiedMonotonicity(org.apache.calcite.rel.RelNode rel)
RelModifiedMonotonicity
statistic.rel
- the relational expressionpublic RelWindowProperties getRelWindowProperties(org.apache.calcite.rel.RelNode rel)
RelWindowProperties
statistic.rel
- the relational expressionpublic Set<org.apache.calcite.util.ImmutableBitSet> getUpsertKeys(org.apache.calcite.rel.RelNode rel)
ImmutableBitSet
, where each bit position represents a 0-based
output column ordinal.
Different from the unique keys: In distributed streaming computing, one record may be divided into RowKind.UPDATE_BEFORE and RowKind.UPDATE_AFTER. If a key changing join is connected downstream, the two records will be divided into different tasks, resulting in disorder. In this case, the downstream cannot rely on the order of the original key. So in this case, it has unique keys in the traditional sense, but it doesn't have upsert keys.
public Set<org.apache.calcite.util.ImmutableBitSet> getUpsertKeysInKeyGroupRange(org.apache.calcite.rel.RelNode rel, int[] partitionKeys)
Some optimizations can rely on this ability to do upsert in a single key group range.
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.