Interface RangeAwareFormatReader

All Superinterfaces:
AutoCloseable, Closeable, FormatReader

public interface RangeAwareFormatReader extends FormatReader
Extension of FormatReader for columnar formats (Parquet, ORC) that support row-group-level split parallelism.

Unlike line-oriented formats that use SegmentableFormatReader with byte-range views, columnar formats need full-file access (e.g. Parquet's footer is at EOF) but can selectively read row groups within a byte range. This interface separates the range specification from the file access, allowing the reader to open the full file and use format-native range filtering (e.g. ParquetReadOptions.withRange()).

The split discovery flow:

  1. discoverSplitRanges(org.elasticsearch.xpack.esql.datasources.spi.StorageObject) reads file metadata (e.g. Parquet footer) and returns byte ranges for each independently readable unit (e.g. row group).
  2. The framework creates one split per range, distributed across drivers/nodes.
  3. At read time, readRange(org.elasticsearch.xpack.esql.datasources.spi.StorageObject, org.elasticsearch.xpack.esql.datasources.spi.RangeReadContext) receives the full-file object and the assigned byte range, reading only the relevant row groups.