Skip to content

Add ArrayReader::skip_records API #2197

@tustvold

Description

@tustvold

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The skip records API added to the ArrayReader trait as part of #1998 does not provide a way to combine multiple selections into the same batch. This is unfortunate as columnar query engines will often want consistently large RecordBatch so that any dispatch overheads can be amortised over many rows. Whilst it could concatenate batches together, e.g. DataFusion's CoalesceBatchesExec, it would be more efficient to do this directly on read and eliminate an additional copy.

Ultimately doing this is supported by the underlying machinery, i.e. RecordReader, it just isn't exposed by ArrayReader

Describe the solution you'd like

Much like RecordReader we need to separate read_records from consuming the resulting data, i.e. replace ArrayReader::next_batch with ArrayReader::read_records and ArrayReader::consume_batch.

Describe alternatives you've considered

We could not do this, however, if we are going to make this change we should probably do it before we make the record skipping API public (#1792)

Metadata

Metadata

Assignees

Labels

enhancementAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions