Class RowPartitionComputer

java.lang.Object
org.apache.flink.connector.file.table.RowPartitionComputer
All Implemented Interfaces:
Serializable, PartitionComputer<org.apache.flink.types.Row>

@Internal public class RowPartitionComputer extends Object implements PartitionComputer<org.apache.flink.types.Row>
See Also:
  • Field Details

    • defaultPartValue

      protected final String defaultPartValue
    • partitionColumns

      protected final String[] partitionColumns
    • partitionIndexes

      protected final int[] partitionIndexes
  • Constructor Details

    • RowPartitionComputer

      public RowPartitionComputer(String defaultPartValue, String[] columnNames, String[] partitionColumns)
  • Method Details

    • generatePartValues

      public LinkedHashMap<String,String> generatePartValues(org.apache.flink.types.Row in) throws Exception
      Description copied from interface: PartitionComputer
      Compute partition values from record.
      Specified by:
      generatePartValues in interface PartitionComputer<org.apache.flink.types.Row>
      Parameters:
      in - input record.
      Returns:
      partition values.
      Throws:
      Exception
    • projectColumnsToWrite

      public org.apache.flink.types.Row projectColumnsToWrite(org.apache.flink.types.Row in)
      Description copied from interface: PartitionComputer
      Project non-partition columns for output writer.
      Specified by:
      projectColumnsToWrite in interface PartitionComputer<org.apache.flink.types.Row>
      Parameters:
      in - input record.
      Returns:
      projected record.
    • restorePartValueFromType

      public static Object restorePartValueFromType(String valStr, org.apache.flink.table.types.DataType type)
    • restorePartValueFromType

      public static Object restorePartValueFromType(String valStr, org.apache.flink.table.types.logical.LogicalType type)
      Restore partition value from string and type. This method is the opposite of method generatePartValues(org.apache.flink.types.Row).
      Parameters:
      valStr - string partition value.
      type - type of partition field.
      Returns:
      partition value.