INSERT nullability: unpartitioned path skips the runtime NULL check; partitioned path rejects nullable sources at plan time
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
Research direction
Start in crates/datafusion/src/table/mod.rs at project_with_partition and crates/datafusion/src/physical_plan/write.rs at execute_input_stream; compare the unpartitioned and partitioned paths with DataFusion's check_not_null_constraints. Reproduce the MemTable INSERT with a nullable id, then verify both paths use the table schema, catch actual NULLs at runtime, and allow nullable sources when no NULL is present.
Written by the indexing model from the issue text.
Description
Reported by @mbutrovich in #19.
Unpartitioned tables: NULLs are written into required columns
The unpartitioned path skips project_with_partition (table/mod.rs), and IcebergWriteExec passes the input's own schema as the sink schema to execute_input_stream (write.rs).
DataFusion only runs check_not_null_constraints for columns that are non-nullable in the sink schema and nullable in the input. Because both schemas are the input's here, the check never runs.
Repro: inserting SELECT * FROM source into an unpartitioned table with a required id: int column, from a MemTable whose nullable id holds [1, NULL], succeeds and reads back 0, 1. The NULL is written as 0.
Partitioned tables: nullable sources are rejected at plan time
The partitioned path goes the other way. project_with_partition rejects any source column that is nullable where the table column is required, even when the source holds no nulls. DataFusion's own sinks accept that case and check at runtime.
Possible fix
Passing the table's Arrow schema (plus the partition column) as the sink schema to execute_input_stream would likely fix both: nulls would be caught at runtime on either path, and the plan-time rejection of nullable sources could be relaxed.
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
higress-group/HiRoute#405 ·
Maintainers usually reply within 1 day
-
rust_analyzer flycheck: no CLI way to enable clippy from `check.overrideCommand`Possibly taken @TrapsterDK claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
bazelbuild/rules_rust#4392 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
🐞 bug 🧩 bevy_gantz_egui
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nannou-org/gantz#500 ·
Maintainers usually reply within 1 day