Class ScanReuserUtils

java.lang.Object
org.apache.flink.table.planner.plan.reuse.ScanReuserUtils

public class ScanReuserUtils extends Object
Utils for ScanReuser.
  • 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

      public static List<SourceAbilitySpec> abilitySpecsWithoutEscaped(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.
    • isEscapeDigest

      public static boolean isEscapeDigest(SourceAbilitySpec spec)
    • containsRexNodeSpecAfterProjection

      public static boolean containsRexNodeSpecAfterProjection(CommonPhysicalTableSourceScan table)
      Contains SourceAbilitySpec.needAdjustFieldReferenceAfterProjection() spec after projection push down except WatermarkPushDownSpec. 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

      public static List<String> metadataKeys(TableSourceTable source)
    • enforceMetadataKeyOrder

      public static List<String> enforceMetadataKeyOrder(Set<String> allUsedMetadataKeys, org.apache.flink.table.connector.source.DynamicTableSource source)
    • concatProjectedFields

      public static int[][] concatProjectedFields(org.apache.flink.table.catalog.ResolvedSchema schema, org.apache.flink.table.types.logical.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(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.
    • getAbilitySpec

      public static <T extends SourceAbilitySpec> T getAbilitySpec(SourceAbilitySpec[] abilitySpecs, Class<T> specClass)
    • pickScanWithWatermark

      public static CommonPhysicalTableSourceScan pickScanWithWatermark(List<CommonPhysicalTableSourceScan> scans)