Interface NestedFieldsProjectableTableSource<T>

  • Type Parameters:
    T - The return type of the TableSource.

    @Deprecated
    @Internal
    public interface NestedFieldsProjectableTableSource<T>
    Deprecated.
    This interface will not be supported in the new source design around DynamicTableSource. Use SupportsProjectionPushDown instead. See FLIP-95 for more information.
    Adds support for projection push-down to a TableSource with nested fields.

    A TableSource extending this interface is able to project the fields of its returned DataStream if it is a StreamTableSource.

    • Method Detail

      • projectNestedFields

        TableSource<T> projectNestedFields​(int[] fields,
                                           String[][] nestedFields)
        Deprecated.
        Creates a copy of the TableSource that projects its output to the given field indexes. The field indexes relate to the physical produced data type (TableSource.getProducedDataType()) and not to the table schema (TableSource.getTableSchema() of the TableSource.

        The table schema (TableSource.getTableSchema() of the TableSource copy must not be modified by this method, but only the produced data type (TableSource.getProducedDataType()) and the produced DataStream ( StreamTableSource.getDataStream()). The produced data type may only be changed by removing or reordering first level fields. The type of the first level fields must not be changed.

        If the TableSource implements the DefinedFieldMapping interface, it might be necessary to adjust the mapping as well.

        The nestedFields parameter contains all nested fields that are accessed by the query. This information can be used to only read and set the accessed fields. Non-accessed fields may be left empty, set to null, or to a default value.

        This method is called with parameters as shown in the example below:

        
         // schema
         tableSchema = {
             id,
             student<\school<\city, tuition>, age, name>,
             teacher<\age, name>
         }
        
         // query
         select (id, student.school.city, student.age, teacher)
        
         // parameters
         fields = field = [0, 1, 2]
         nestedFields  \[\["*"], ["school.city", "age"], ["*"\]\]
         

        IMPORTANT: This method must return a true copy and must not modify the original table source object.

        Parameters:
        fields - The indexes of the fields to return.
        nestedFields - The paths of all nested fields which are accessed by the query. All other nested fields may be empty.
        Returns:
        A copy of the TableSource that projects its output.