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(Path currPath)
Make partition spec from path.
|
static List<String> |
extractPartitionValues(Path currPath)
Make partition values from path.
|
static GenericRowData |
fillPartitionValueForRecord(String[] fieldNames,
DataType[] fieldTypes,
int[] selectFields,
List<String> partitionKeys,
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 FileStatus[] |
listStatusWithoutHidden(FileSystem fs,
Path dir)
List file status without hidden files.
|
static List<Tuple2<LinkedHashMap<String,String>,Path>> |
searchPartSpecAndPaths(FileSystem 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(Path currPath)
currPath
- partition file path.public static LinkedHashMap<String,String> extractPartitionSpecFromPath(Path currPath)
currPath
- partition file path.public static FileStatus[] listStatusWithoutHidden(FileSystem fs, Path dir) throws IOException
IOException
public static List<Tuple2<LinkedHashMap<String,String>,Path>> searchPartSpecAndPaths(FileSystem 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, 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–2024 The Apache Software Foundation. All rights reserved.