Reading a Variant column from Parquet files with different shredding layouts null-fills typed_value; every shredded field then reads as NULL, with no error
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with the linked schema inference and rewrite functions in datafusion/datasource-parquet/src/file_format.rs and datafusion/physical-expr-adapter/src/schema_rewriter.rs, then read #26282 and the Variant shredding specification. Reproduce with the two mixed-layout Parquet cases in the issue and trace how the adapter handles the missing typed_value children. Done means mixed layouts preserve the Variant fields across files, with coverage for both cases.
由索引模型根据 Issue 内容生成。
描述
Part of #26517.
Is your feature request related to a problem or challenge?
I have a table of Parquet files with one Variant column, event. Each row is a small JSON object like {"service":"api","status":200,"latency_ms":12}. The files were not all written the same way:
a.parquetis shredded onserviceandstatus. Those two fields are stored as typed columns undertyped_value; the rest stays invalue.b.parquetis not shredded. The whole object is invalue, there is notyped_value.
Both files hold the same 3 rows. Spark reads a table like this fine. Each file also reads fine on its own in DataFusion.
Query (with datafusion-variant registered):
SELECT variant_get(event, 'service', 'VARCHAR') AS service FROM events
What I get:
+---------+
| service |
+---------+
| api | <- a.parquet
| api |
| db |
| | <- b.parquet
| |
| |
+---------+
What I expect: api, api, db for both files, so 6 non-null rows. That is what each file returns on its own.
What happens: the merged table schema has typed_value, and b.parquet does not. The schema adapter fills typed_value with NULL for that file. For a plain struct that is right. For Variant it is not: the shredding spec says a NULL typed_value means "this value is not an object", so the reader never looks in value for service. The data is still there, it is just skipped. No error, no warning.
The same thing happens when two files are shredded on different fields. Before #26195 that case failed at open; on branch-56 it null-fills too.
Describe the solution you'd like
Let an extension type decide how a file's layout maps to the table's layout, instead of the default struct null-fill. The Variant version would live in datafusion-variant. Per the discussion below I am starting with a PhysicalExprAdapter there and will report back on what, if anything, core needs.
Additional context
Repro: a 90-line Rust program that writes the two files with arrow-rs shred_variant and runs the query. It is in the edit history of this issue; I will replace it with a SQL-only version once datafusion-contrib/datafusion-variant#145 (COPY ... OPTIONS ('variant.shredding' ...)) lands.
DataFusion branch-56 at 1635ed9, arrow/parquet 60.1, datafusion-variant 642248a.
- 主要语言
- Rust
- 星标
- 9.6k
- 派生
- 2.6k
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 345
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion#27315 · 2 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
apache/datafusion#27094 · 1 条评论 ·
维护者通常 1 天内回复
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yaml可能已有人在做 @jonasHanhan 于 9 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
apache/datafusion#27059 ·
维护者通常 1 天内回复
-
`ProjectionExprs::project_statistics` computes approximate `Statistics::total_byte_size` ignoring column stats可能已有人在做 @joseph-isaacs 于 10 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion#27050 ·
维护者通常 1 天内回复
-
physical-plan: decoding an Unnest or Explain node with an unset field panics可能已有人在做 @geoHeil 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
apache/datafusion#26999 · 1 条评论 ·
维护者通常 1 天内回复
查看 apache/datafusion 的全部 Issue
相似的 Issue
-
P3
难度 2/5 1-3 小时 新手友好度 70/100
HerringtonDarkholme/hd-lang#1770 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
jonathanong/no-mistakes#3332 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
swc-project/swc-next-issues#310 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
swc-project/swc-ai-issues#653 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
lbjlaq/Antigravity-Manager#3937 ·
维护者通常 1 天内回复