Repository navigation
feat: configure Iceberg Arrow reader options per query - #142
alexanderbianchi wants to merge 3 commits into
Conversation
59d67ca to
d4a11e8
Compare
|
One thing about the default of I checked this on main (9381791) with a storage wrapper that adds 20 ms to each data-file read and records how many files have reads in flight at once, over the 7-file taxi table:
The limit of one makes sense for eager scans spread over (I ran into this in Ballista, where every Iceberg scan is lazy, and thinking about passing a reader the limit unset to get around this.) |
iceberg-datafusion's default reader reads one data file at a time per output partition, but a lazy scan has one partition, so Ballista's Iceberg scans read their files one after another. Before the upgrade they read up to one file per CPU at once, through TableScan::to_arrow. Build the reader in one helper shared by PinnedTable::scan and the physical codec: it keeps batch size and page index from the session and leaves the concurrency limit to Iceberg. Reported upstream on apache/datafusion-iceberg#142.
Depends on #141 for the upstream reader options API. This carries forward the concurrency and pruning settings from #126.
Rust callers can pass the upstream
iceberg::arrow::ArrowReaderOptionsdirectly when building a config for a query:Both Iceberg table providers use that complete value when planning the scan. Fields the caller leaves unset take Iceberg defaults, including host parallelism for unset file concurrency. An explicit
IcebergDataSourceBuilder::with_readerstill takes precedence.Without a typed override, the reader uses the session settings below. SQL users can register
IcebergDataFusionConfigand run, for example,SET iceberg.execution.data_file_concurrency_limit = 4before planning a scan.datafusion.executionbatch_sizedatafusion.execution.parquetpruning,enable_page_index,bloom_filter_on_read,metadata_size_hinticeberg.executiondata_file_concurrency_limit(default one per output partition)iceberg.execution.parquetrange_coalesce_bytes,range_fetch_concurrency,preload_column_index,preload_offset_index,preload_page_indexThis enables Bloom-filter reads by default in the session-settings path, following DataFusion. Iceberg accepts the stored
preload_page_indexflag but derives its effective value per file from predicates and deletes.Two scan tests cover the integration. A typed batch size of 137 overrides the session setting of 2,000. Enabling row-group pruning returns the same rows with fewer reads.
Verified locally with
cargo fmt --all -- --check,cargo clippy --workspace --locked --all-targets -- -D warnings, andcargo test --workspace --locked.