Class HivePartitionDetector

java.lang.Object
org.elasticsearch.xpack.esql.datasources.HivePartitionDetector
All Implemented Interfaces:
PartitionDetector

public final class HivePartitionDetector extends Object implements 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 Details

    • INSTANCE

      public static final HivePartitionDetector INSTANCE
    • HIVE_DEFAULT_PARTITION

      public static final String 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, otherwise WHERE col IS NULL silently misses rows and STATS BY col buckets them under a phantom string key.
      See Also:
    • RESERVED_RENAME_PREFIX

      public static final String 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, or METADATA _index would 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 a Warning header discloses each rename. Shared by every detector; see ReservedPartitionNames.
      See Also:
  • Method Details