Bound the sorted-scan merge by how many files' key ranges overlap
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with IcebergDataSource and StreamingMergeBuilder, then review DataFusion's split_groups_by_statistics for the overlap grouping approach. The issue says per-file column statistics on FileScanTask and an iceberg-rust revision bump are prerequisites; the maintainer is preparing that change. Done means sorted scans bound the merge by maximum file range overlap, preserve sort-key and null ordering, and safely handle missing or promoted-type bounds; this work is already underway.
由索引模型根据 Issue 内容生成。
描述
With iceberg.execution.preserve_data_ordering, #55 merges one reader per data file with every file open at once, so iceberg.execution.max_merge_files_per_partition caps the number of files. A sorted table with many small commits goes over the cap and loses its order, even when most of its files don't overlap.
The plan is to bound the merge by overlap instead of file count. IcebergDataSource would read each file's bounds and null counts for the sort columns, sort the files by their first key in output order, and put each file after the first chain whose last file ends at or before it. DataFusion's split_groups_by_statistics does the same. Each chain is read one file at a time, the chains are k-way merged, and max_merge_files applies to the number of chains, which equals the maximum overlap depth. A table whose files don't overlap then merges nothing.
Cases that need care:
- Files are compared over every claimed sort key, not just the leading one. With a tie on the leading key, comparing only that key could put one file's rows ahead of the other's when the second key says otherwise.
- Under NULLS FIRST a file with nulls can only start a chain, and under NULLS LAST it can only end one. A missing null count on an optional column counts as nulls.
- Descending keys swap the bounds.
- Truncated string bounds stay correct; they just overlap more.
- A file with missing bounds, or a bound typed differently from the column after a type promotion, gets a chain of its own. With no bounds at all, the scan behaves exactly as after #55.
- Listing every file at planning time also needs a cap of its own.
This needs per-file column statistics on FileScanTask, which iceberg-rust doesn't carry today. That change is apache/iceberg-rust#3422, in PR apache/iceberg-rust#3424. Once it merges, this needs a bump of the iceberg-rust rev.
Related: In https://github.com/apache/datafusion-comet/pull/5331#discussion_r3830848772, @mbutrovich proposed admitting unopened files from a priority queue ordered by min bound. That bounds open readers by the same overlap depth and opens files later, which helps LIMIT, but it needs a custom merge operator. Chains reuse StreamingMergeBuilder, so I'd start there and keep admission as a possible next step.
I'm working on this and will put up the PR here once #55 and the iceberg-rust change have merged.
- 主要语言
- Rust
- 星标
- 30
- 派生
- 30
- 平均合并
- 3 天 19 小时
- 30 天内合并 PR
- 15
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion-iceberg 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
apache/datafusion-iceberg#100 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 25/100
apache/datafusion-iceberg#85 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
apache/datafusion-iceberg#84 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
apache/datafusion-iceberg#75 ·
维护者通常 1 天内回复
-
Slow CI runners未关闭
难度 4/5 3-5 天 新手友好度 18/100
apache/datafusion-iceberg#74 ·
维护者通常 1 天内回复
查看 apache/datafusion-iceberg 的全部 Issue
相似的 Issue
-
bug i18n priority: medium ui
难度 2/5 1-3 小时 新手友好度 65/100
storytold/craft-anything#983 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
Dinnerbone/Rascal#91 · 2 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 76/100
higress-group/HiRoute#405 ·
维护者通常 1 天内回复
-
rust_analyzer flycheck: no CLI way to enable clippy from `check.overrideCommand`可能已有人在做 @TrapsterDK 今天认领。 未关闭needs-triage
难度 2/5 1-3 小时 新手友好度 77/100
bazelbuild/rules_rust#4392 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复