Commit c915c31
authored
fix(datafusion): reject non-append insert operations (#2714)
## Which issue does this PR close?
- Closes #2711.
## What changes are included in this PR?
Reject DataFusion `InsertOp::Overwrite` and `InsertOp::Replace` before
constructing an Iceberg write plan.
Previously, `IcebergTableProvider::insert_into` ignored the requested
insert operation while the commit executor always used `fast_append`.
Unsupported overwrite or replace requests could therefore be silently
executed with append semantics.
This patch keeps the existing append path unchanged and returns
`DataFusionError::NotImplemented` for unsupported insert operations. It
preserves the existing `_insert_op` parameter name to avoid changing the
generated public API snapshot.
## Are these changes tested?
Yes. Added unit tests verifying that:
- `InsertOp::Overwrite` returns `DataFusionError::NotImplemented`.
- `InsertOp::Replace` returns `DataFusionError::NotImplemented`.
- Existing append-insert behavior remains unchanged.
Local verification:
- `cargo test -p iceberg-datafusion test_catalog_backed_provider_rejects
-- --nocapture`
- `cargo fmt --all -- --check`
- `git diff --check`1 parent 4215bd3 commit c915c31
1 file changed
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
710 | 716 | | |
711 | 717 | | |
712 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
713 | 755 | | |
714 | 756 | | |
715 | 757 | | |
| |||
0 commit comments