Class ScanReuserUtils
java.lang.Object
org.apache.flink.table.planner.plan.reuse.ScanReuserUtils
Utils for
ScanReuser.-
Method Summary
Modifier and TypeMethodDescriptionstatic List<SourceAbilitySpec>abilitySpecsWithoutEscaped(TableSourceTable table) Returns a list ofSourceAbilitySpecinstances associated with a givenTableSourceTableinstance, excluding some particular abilities, such asProjectPushDownSpec.static int[][]concatProjectedFields(org.apache.flink.table.catalog.ResolvedSchema schema, org.apache.flink.table.types.logical.RowType originType, int[][] physicalFields, List<String> metaKeys) static booleancontainsRexNodeSpecAfterProjection(CommonPhysicalTableSourceScan table) ContainsSourceAbilitySpec.needAdjustFieldReferenceAfterProjection()spec after projection push down exceptWatermarkPushDownSpec.static org.apache.calcite.rel.core.CalccreateCalcForScan(org.apache.calcite.rel.RelNode input, org.apache.calcite.rex.RexProgram program) enforceMetadataKeyOrder(Set<String> allUsedMetadataKeys, org.apache.flink.table.connector.source.DynamicTableSource source) static <T extends SourceAbilitySpec>
TgetAbilitySpec(SourceAbilitySpec[] abilitySpecs, Class<T> specClass) static Optional<WatermarkPushDownSpec>getAdjustedWatermarkSpec(TableSourceTable table, org.apache.flink.table.types.logical.RowType oldSourceType, org.apache.flink.table.types.logical.RowType newSourceType) Watermark push down must be after projection push down, so we need to adjust its index.static StringgetDigest(CommonPhysicalTableSourceScan scan, boolean withoutEscape) Get the digest ofCommonPhysicalTableSourceScan, which ignoring certainSourceAbilitySpec.static intindexOf(int[][] projectedFields, int[] fieldIndices) Found the index of specific projected field in the nested array which is made up of all projected fields index paths.static booleanmetadataKeys(TableSourceTable source) static CommonPhysicalTableSourceScanpickScanWithWatermark(List<CommonPhysicalTableSourceScan> scans) static int[][]projectedFields(TableSourceTable source) static booleanreusableWithoutAdjust(List<? extends org.apache.calcite.rel.RelNode> reusableNodes)
-
Method Details
-
indexOf
public static int indexOf(int[][] projectedFields, int[] fieldIndices) Found the index of specific projected field in the nested array which is made up of all projected fields index paths. -
abilitySpecsWithoutEscaped
Returns a list ofSourceAbilitySpecinstances associated with a givenTableSourceTableinstance, excluding some particular abilities, such asProjectPushDownSpec. These abilities don't need before do scan reuse. -
isEscapeDigest
-
containsRexNodeSpecAfterProjection
public static boolean containsRexNodeSpecAfterProjection(CommonPhysicalTableSourceScan table) ContainsSourceAbilitySpec.needAdjustFieldReferenceAfterProjection()spec after projection push down exceptWatermarkPushDownSpec. We have customized the solution for watermark push down. -
getAdjustedWatermarkSpec
public static Optional<WatermarkPushDownSpec> getAdjustedWatermarkSpec(TableSourceTable table, org.apache.flink.table.types.logical.RowType oldSourceType, org.apache.flink.table.types.logical.RowType newSourceType) Watermark push down must be after projection push down, so we need to adjust its index. -
createCalcForScan
public static org.apache.calcite.rel.core.Calc createCalcForScan(org.apache.calcite.rel.RelNode input, org.apache.calcite.rex.RexProgram program) -
projectedFields
public static int[][] projectedFields(TableSourceTable source) -
metadataKeys
-
enforceMetadataKeyOrder
-
concatProjectedFields
-
reusableWithoutAdjust
public static boolean reusableWithoutAdjust(List<? extends org.apache.calcite.rel.RelNode> reusableNodes) -
getDigest
Get the digest ofCommonPhysicalTableSourceScan, which ignoring certainSourceAbilitySpec.- Parameters:
scan- inputCommonPhysicalTableSourceScan.withoutEscape- Whether to include these escapeSourceAbilitySpecs in returned digest.- Returns:
- the digest that ignore certain
SourceAbilitySpec.
-
getAbilitySpec
public static <T extends SourceAbilitySpec> T getAbilitySpec(SourceAbilitySpec[] abilitySpecs, Class<T> specClass) -
pickScanWithWatermark
public static CommonPhysicalTableSourceScan pickScanWithWatermark(List<CommonPhysicalTableSourceScan> scans)
-