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>
PartitionComputerforRow.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdefaultPartValueprotected String[]partitionColumnsprotected int[]partitionIndexes
-
Constructor Summary
Constructors Constructor Description RowPartitionComputer(String defaultPartValue, String[] columnNames, String[] partitionColumns)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkedHashMap<String,String>generatePartValues(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.
-
-
-
Method Detail
-
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
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 methodgeneratePartValues(org.apache.flink.types.Row).- Parameters:
valStr- string partition value.type- type of partition field.- Returns:
- partition value.
-
-