Package dev.vortex.spark.read
Class PartitionPathUtils
java.lang.Object
dev.vortex.spark.read.PartitionPathUtils
Utilities for discovering and materializing Hive-style partition columns from file paths.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.spark.sql.execution.vectorized.ConstantColumnVectorcreateConstantVector(int numRows, org.apache.spark.sql.types.DataType type, String value) Creates a SparkConstantColumnVectorpopulated with the given partition value, parsed according to the targetDataType.static org.apache.spark.sql.types.DataTypeinferPartitionColumnType(String value) Infers a SparkDataTypefrom a partition value string.parsePartitionValues(String filePath) Parses Hive-stylekey=valuesegments from a file path.
-
Method Details
-
parsePartitionValues
Parses Hive-stylekey=valuesegments from a file path.- Returns:
- an ordered map of partition column names to their string values
-
inferPartitionColumnType
Infers a SparkDataTypefrom a partition value string. Tries integer, long, double, boolean, and falls back to string. -
createConstantVector
public static org.apache.spark.sql.execution.vectorized.ConstantColumnVector createConstantVector(int numRows, org.apache.spark.sql.types.DataType type, String value) Creates a SparkConstantColumnVectorpopulated with the given partition value, parsed according to the targetDataType.
-