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>
PartitionComputer for Row.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRowPartitionComputer(String defaultPartValue, String[] columnNames, String[] partitionColumns) -
Method Summary
Modifier and TypeMethodDescriptiongeneratePartValues(org.apache.flink.types.Row in) Compute partition values from record.org.apache.flink.types.RowprojectColumnsToWrite(org.apache.flink.types.Row in) Project non-partition columns for output writer.static ObjectrestorePartValueFromType(String valStr, org.apache.flink.table.types.DataType type) static ObjectrestorePartValueFromType(String valStr, org.apache.flink.table.types.logical.LogicalType type) Restore partition value from string and type.
-
Field Details
-
defaultPartValue
-
partitionColumns
-
partitionIndexes
protected final int[] partitionIndexes
-
-
Constructor Details
-
RowPartitionComputer
-
-
Method Details
-
generatePartValues
public LinkedHashMap<String,String> generatePartValues(org.apache.flink.types.Row in) throws Exception Description copied from interface:PartitionComputerCompute partition values from record.- Specified by:
generatePartValuesin interfacePartitionComputer<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:PartitionComputerProject non-partition columns for output writer.- Specified by:
projectColumnsToWritein interfacePartitionComputer<org.apache.flink.types.Row>- Parameters:
in- input record.- Returns:
- projected record.
-
restorePartValueFromType
-
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 methodgeneratePartValues(org.apache.flink.types.Row).- Parameters:
valStr- string partition value.type- type of partition field.- Returns:
- partition value.
-