Add sqllogictests for scans after a schema change with no write since
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the sqllogictest files in the datafusion-iceberg repo and the engine setup that runs DataFusion only, then find where a test could call Transaction::update_schema() in iceberg-rust. Confirm the dependency includes apache/iceberg-rust#2904 before writing tests. Done means sqllogictests cover column add, drop, drop-and-re-add with the same name, and rename after a schema change with no write, and they pass.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem or challenge?
apache/iceberg-rust#2904 changes TableScanBuilder::build so that a scan that doesn't pin a snapshot projects the table's current schema, not the schema of the snapshot it reads. Before it, a scan of a table whose schema changed after its last write resolved columns against the older schema. That is the root cause of #42.
That PR checks the snapshot and schema a scan resolves with unit tests. End-to-end checks of the rows read back were asked to live here as sqllogictests rather than as integration tests in iceberg-rust (review comment).
Describe the solution you'd like
Once this crate depends on an iceberg-rust release that includes apache/iceberg-rust#2904, add sqllogictests that change a table's schema after its last write, with no write since, and check what queries return:
- Column added:
SELECT *returns the new column as NULL for every existing row.WHERE c IS NULLmatches every row, andWHERE c = <value>matches none. This covers #42. - Column dropped: selecting the dropped column fails with a column-not-found error, and
SELECT *no longer returns it. - Column dropped and added back under the same name: the new column reads as NULL, not the old column's values. Data files are matched by field ID, and the new field ID isn't in any file.
- Column renamed: the values read back under the new name.
The sqllogictest engine here runs only DataFusion, and DataFusion SQL can't change an Iceberg table's schema. These tests need a way to do it, for example a setup step that calls Transaction::update_schema() or a Spark engine, as the README lists.
Additional context
- #42:
SELECT *fails after a column is added until the next write to the table. - #57 is related but not covered here: a provider built before the schema change keeps its cached schema.
- 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
-
Slow CI runnersOpen
Difficulty 4/5 3-5 days Newbie friendliness 18/100
apache/datafusion-iceberg#74 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/datafusion-iceberg#73 ·
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