Class ScanReuserUtils

    • Method Detail

      • 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

        public static List<SourceAbilitySpec> abilitySpecsWithoutEscaped​(org.apache.flink.table.planner.plan.schema.TableSourceTable table)
        Returns a list of SourceAbilitySpec instances associated with a given TableSourceTable instance, excluding some particular abilities, such as ProjectPushDownSpec. These abilities don't need before do scan reuse.
      • getAdjustedWatermarkSpec

        public static Optional<WatermarkPushDownSpec> getAdjustedWatermarkSpec​(org.apache.flink.table.planner.plan.schema.TableSourceTable table,
                                                                               RowType oldSourceType,
                                                                               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​(org.apache.flink.table.planner.plan.schema.TableSourceTable source)
      • metadataKeys

        public static List<String> metadataKeys​(org.apache.flink.table.planner.plan.schema.TableSourceTable source)
      • concatProjectedFields

        public static int[][] concatProjectedFields​(ResolvedSchema schema,
                                                    RowType originType,
                                                    int[][] physicalFields,
                                                    List<String> metaKeys)
      • reusableWithoutAdjust

        public static boolean reusableWithoutAdjust​(List<? extends org.apache.calcite.rel.RelNode> reusableNodes)
      • getDigest

        public static String getDigest​(org.apache.flink.table.planner.plan.nodes.physical.common.CommonPhysicalTableSourceScan scan,
                                       boolean withoutEscape)
        Get the digest of CommonPhysicalTableSourceScan, which ignoring certain SourceAbilitySpec.
        Parameters:
        scan - input CommonPhysicalTableSourceScan.
        withoutEscape - Whether to include these escape SourceAbilitySpecs in returned digest.
        Returns:
        the digest that ignore certain SourceAbilitySpec.
      • pickScanWithWatermark

        public static org.apache.flink.table.planner.plan.nodes.physical.common.CommonPhysicalTableSourceScan pickScanWithWatermark​(List<org.apache.flink.table.planner.plan.nodes.physical.common.CommonPhysicalTableSourceScan> scans)