Class TableDataTypeUtils


  • public class TableDataTypeUtils
    extends Object
    Utility class for manipulating DataType objects, particularly for table schemas. This class provides methods that were removed from the Flink API in version 2.1.0. See Flink PR 26784.
    • Constructor Detail

      • TableDataTypeUtils

        public TableDataTypeUtils()
    • Method Detail

      • stripRowPrefix

        public static org.apache.flink.table.types.DataType stripRowPrefix​(org.apache.flink.table.types.DataType dataType,
                                                                           String prefix)
        Removes a string prefix from the fields of the given row data type.
        Parameters:
        dataType - The row data type to modify.
        prefix - The prefix to remove from the field names.
        Returns:
        A new DataType with the modified field names.
        Throws:
        IllegalArgumentException - if the provided dataType is not of ROW type.
      • renameRowFields

        public static org.apache.flink.table.types.logical.RowType renameRowFields​(org.apache.flink.table.types.logical.RowType rowType,
                                                                                   List<String> newFieldNames)
        Renames the fields of the given RowType.
        Parameters:
        rowType - The original RowType.
        newFieldNames - The new field names to apply.
        Returns:
        A new RowType with the updated field names.
        Throws:
        IllegalArgumentException - if the number of new field names does not match the number of fields in the original RowType.