@Internal public class PartitionPathUtils extends Object
| Constructor and Description |
|---|
PartitionPathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
convertStringToInternalValue(String valStr,
DataType type)
Restore partition value from string and type.
|
static LinkedHashMap<String,String> |
extractPartitionSpecFromPath(org.apache.flink.core.fs.Path currPath)
Make partition spec from path.
|
static List<String> |
extractPartitionValues(org.apache.flink.core.fs.Path currPath)
Make partition values from path.
|
static GenericRowData |
fillPartitionValueForRecord(String[] fieldNames,
DataType[] fieldTypes,
int[] selectFields,
List<String> partitionKeys,
org.apache.flink.core.fs.Path path,
String defaultPartValue)
Extract partition value from path and fill to record.
|
static String |
generatePartitionPath(LinkedHashMap<String,String> partitionSpec)
Make partition path from partition spec.
|
static org.apache.flink.core.fs.FileStatus[] |
listStatusWithoutHidden(org.apache.flink.core.fs.FileSystem fs,
org.apache.flink.core.fs.Path dir)
List file status without hidden files.
|
static List<org.apache.flink.api.java.tuple.Tuple2<LinkedHashMap<String,String>,org.apache.flink.core.fs.Path>> |
searchPartSpecAndPaths(org.apache.flink.core.fs.FileSystem fs,
org.apache.flink.core.fs.Path path,
int partitionNumber)
Search all partitions in this path.
|
static String |
unescapePathName(String path) |
public static String generatePartitionPath(LinkedHashMap<String,String> partitionSpec)
partitionSpec - The partition spec.public static List<String> extractPartitionValues(org.apache.flink.core.fs.Path currPath)
currPath - partition file path.public static LinkedHashMap<String,String> extractPartitionSpecFromPath(org.apache.flink.core.fs.Path currPath)
currPath - partition file path.public static org.apache.flink.core.fs.FileStatus[] listStatusWithoutHidden(org.apache.flink.core.fs.FileSystem fs,
org.apache.flink.core.fs.Path dir)
throws IOException
IOExceptionpublic static List<org.apache.flink.api.java.tuple.Tuple2<LinkedHashMap<String,String>,org.apache.flink.core.fs.Path>> searchPartSpecAndPaths(org.apache.flink.core.fs.FileSystem fs, org.apache.flink.core.fs.Path path, int partitionNumber)
path - search path.partitionNumber - partition number, it will affect path structure.public static GenericRowData fillPartitionValueForRecord(String[] fieldNames, DataType[] fieldTypes, int[] selectFields, List<String> partitionKeys, org.apache.flink.core.fs.Path path, String defaultPartValue)
fieldNames - record field names.fieldTypes - record field types.selectFields - the selected fields.partitionKeys - the partition field names.path - the file path that the partition located.defaultPartValue - default value of partition field.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.