`SELECT *` fails after a column is added until the next write to the table
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Start by reproducing the query after the schema-only column addition, then read crates/datafusion/src/table/mod.rs at the provider declarations and iceberg-rust's TableScanBuilder::build, which binds scans to the snapshot schema. Done means the fresh provider can run SELECT * and return the existing value with NULL for the newly added column without a new table write.
Written by the indexing model from the issue text.
Description
Describe the bug
IcebergTableProvider and IcebergStaticTableProvider::try_new_from_table declare the table's current schema (table/mod.rs#L94-L97, table/mod.rs#L258-L262). iceberg-rust's scan binds the projection and filters to the schema of the snapshot it reads instead: TableScanBuilder::build uses snapshot.schema(...). After a schema change that has no snapshot of its own, the provider declares columns the scan can't find.
To Reproduce
- Create
t(a INT NOT NULL)and insert one row. - Add an optional column
c STRING, for example withTransaction::update_schema().add_column(AddColumn::optional("c", ...))or withALTER TABLE ... ADD COLUMNfrom Spark. Don't write any new data. - Build a fresh provider and run
SELECT * FROM t:
DataInvalid => Column c not found in table. Schema: table {
1: a: required int
}
Expected behavior
The query returns a = 1, c = NULL.
Additional context
The root cause is the iceberg-rust scan behavior tracked in apache/iceberg-rust#2565 and apache/iceberg-rust#2905. Until that's fixed upstream, this crate could declare the scanned snapshot's schema, or fill columns missing from it with nulls.
- Dominant language
- Rust
- Stars
- 30
- Forks
- 30
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/datafusion-iceberg
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apache/datafusion-iceberg#100 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
apache/datafusion-iceberg#85 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
apache/datafusion-iceberg#84 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/datafusion-iceberg#75 ·
Maintainers usually reply within 1 day
-
Slow CI runnersOpen
Difficulty 4/5 3-5 days Newbie friendliness 18/100
apache/datafusion-iceberg#74 ·
Maintainers usually reply within 1 day
All issues in apache/datafusion-iceberg
Similar issues
-
🐞 bug 🧩 bevy_gantz_egui
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nannou-org/gantz#500 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
metasequoiaime/msime#10989 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fritzprix/libr-agent#2612 ·
Maintainers usually reply within 1 day
-
crate: spate-core priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NSPG13/agent-bounties#1749 ·
Maintainers usually reply within 1 day