Class HivePartitionDetector
java.lang.Object
org.elasticsearch.xpack.esql.datasources.HivePartitionDetector
- All Implemented Interfaces:
PartitionDetector
Detects Hive-style partition columns from file paths (e.g.,
/year=2024/month=06/file.parquet).
Parses key=value segments, validates consistency across all files, and infers types
using Spark-style rules: try Integer, Long, Double, Boolean, fallback to keyword.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSentinel directory name written by Hive for rows whose partition column is NULL.static final HivePartitionDetectorstatic final StringPrefix applied to a partition column whose name collides with a dedicated metadata name. -
Method Summary
-
Field Details
-
INSTANCE
-
HIVE_DEFAULT_PARTITION
Sentinel directory name written by Hive for rows whose partition column is NULL. When this token appears as a Hive-style key=value segment value, it must be surfaced as SQL NULL rather than the literal string, otherwiseWHERE col IS NULLsilently misses rows andSTATS BY colbuckets them under a phantom string key.- See Also:
-
RESERVED_RENAME_PREFIX
Prefix applied to a partition column whose name collides with a dedicated metadata name. Standard metadata (_id,_index, ...), the_file.*family, and reader-synthesized channel names are reserved: a layout author cannot claim them, orMETADATA _indexwould silently return the partition value instead of its spec-defined meaning (the dataset name). A directory like/_index=foo/surfaces as_partition._index— the spec name keeps its meaning, the layout's value stays queryable, and aWarningheader discloses each rename. Shared by every detector; seeReservedPartitionNames.- See Also:
-
-
Method Details
-
name
- Specified by:
namein interfacePartitionDetector
-
detect
- Specified by:
detectin interfacePartitionDetector
-