Class RowPartitionComputer
- java.lang.Object
-
- org.apache.flink.connector.file.table.RowPartitionComputer
-
- All Implemented Interfaces:
Serializable
,PartitionComputer<Row>
@Internal public class RowPartitionComputer extends Object implements PartitionComputer<Row>
PartitionComputer
forRow
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
defaultPartValue
protected String[]
partitionColumns
protected 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(Row in)
Compute partition values from record.Row
projectColumnsToWrite(Row in)
Project non-partition columns for output writer.static Object
restorePartValueFromType(String valStr, DataType type)
static Object
restorePartValueFromType(String valStr, LogicalType type)
Restore partition value from string and type.
-
-
-
Method Detail
-
generatePartValues
public LinkedHashMap<String,String> generatePartValues(Row in) throws Exception
Description copied from interface:PartitionComputer
Compute partition values from record.- Specified by:
generatePartValues
in interfacePartitionComputer<Row>
- Parameters:
in
- input record.- Returns:
- partition values.
- Throws:
Exception
-
projectColumnsToWrite
public Row projectColumnsToWrite(Row in)
Description copied from interface:PartitionComputer
Project non-partition columns for output writer.- Specified by:
projectColumnsToWrite
in interfacePartitionComputer<Row>
- Parameters:
in
- input record.- Returns:
- projected record.
-
restorePartValueFromType
public static Object restorePartValueFromType(String valStr, DataType type)
-
restorePartValueFromType
public static Object restorePartValueFromType(String valStr, 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.
-
-