Class NullSpliceRowPositionStrategy
java.lang.Object
org.elasticsearch.xpack.esql.datasources.spi.NullSpliceRowPositionStrategy
- All Implemented Interfaces:
RowPositionStrategy
Strategy for readers that have no native row-position channel and must surface
_rowPosition
as a NULL column (parquet-rs today; the Rust bridge does not yet expose row positions). The
reader strips _rowPosition from its native projection so the inner iterator's pages do
not carry the column at all; apply(org.elasticsearch.compute.operator.CloseableIterator<org.elasticsearch.compute.data.Page>, int) wraps the iterator and splices a constant-null
LongBlock at the slot the user's projection requested.
The downstream VirtualColumnIterator composes _id from the row-position channel;
a null splice yields null _file.record_ref and null _id, matching the documented
"row-position unsupported on this reader" semantics. The reason() string carries the
explanation the wrapping iterator embeds in its describe() output.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(CloseableIterator<Page> inner, int rowPositionSlot) Wrap (or pass through) the reader's inner page iterator so each page has the_rowPositionslot populated.reason()Human-readable reason why this strategy emits the shape it does, available to wrapping iterators for theirdescribe()output (the null-splice iterator embeds it) so_idcomposition against a null-splice reader is attributable rather than silently null.
-
Constructor Details
-
NullSpliceRowPositionStrategy
- Parameters:
blockFactory- used to allocate the per-page null block; carry the same factory the reader uses for its inner iterator so block ownership and breaker accounting stay coherent.reason- user-facing reason this reader cannot supply a real row position (surfaced inreason()and in iteratordescribe()).
-
-
Method Details
-
reason
Description copied from interface:RowPositionStrategyHuman-readable reason why this strategy emits the shape it does, available to wrapping iterators for theirdescribe()output (the null-splice iterator embeds it) so_idcomposition against a null-splice reader is attributable rather than silently null. The default returns the simple class name; the null-splice strategy overrides to expose its constructor reason.- Specified by:
reasonin interfaceRowPositionStrategy
-
apply
Description copied from interface:RowPositionStrategyWrap (or pass through) the reader's inner page iterator so each page has the_rowPositionslot populated. Validates any preconditions this strategy requires; throwsIllegalStateExceptionwhen a precondition is unmet (e.g. byte-offset strategy called with no decompressed anchor).- Specified by:
applyin interfaceRowPositionStrategy- Parameters:
rowPositionSlot- the index in the projected output where_rowPositionsits, or-1when_rowPositionis not in the projection. The dispatcher pre-computes this once perreader.read()so strategies inspect a primitive instead of walking a list per call.
-