Interface SupportsTargetColumnWriting


  • @PublicEvolving
    public interface SupportsTargetColumnWriting
    Interface for DynamicTableSinks that support target column writing.

    The planner will parse target columns from the DML clause and call applyTargetColumns(int[][]) to pass an array of column index paths to the sink.

    The array indices are 0-based and support composite columns within (possibly nested) structures. This information comes from the column list of the DML clause, e.g., for a sink table t1 whose schema is: a STRING, b ROW < b1 INT, b2 STRING>, c BIGINT

    • insert: 'insert into t1(a, b.b2) ...', the column list will be 'a, b.b2', and will provide [[0], [1, 1]]. The statement 'insert into t1 select ...' will provide an empty list and will not apply this ability.
    • update: 'update t1 set a=1, b.b1=2 where ...', the column list will be 'a, b.b1', and will provide [[0], [1, 0]].

    Note: Planner will not apply this ability for the delete statement because it has no column list.

    A sink can use this information to perform target columns writing.

    If this interface is implemented and applyTargetColumns(int[][]) returns true. The planner will use this information for plan optimization such as sink reuse.

    • Method Detail

      • applyTargetColumns

        boolean applyTargetColumns​(int[][] targetColumns)
        Provides an array of column index paths related to user specified target column list.

        See the documentation of SupportsTargetColumnWriting for more information.

        Parameters:
        targetColumns - column index paths
        Returns:
        true if the target columns are applied successfully, false otherwise.