NoahKusaba opened a new pull request, #157:
URL: https://github.com/apache/datafusion-iceberg/pull/157

   ## Which issue does this PR close?
   
   None. Opened as a draft to discuss the approach, since it's a breaking 
change.
   
   ## Rationale for this change
   
   `IcebergCommitExec` reimplements DataFusion's `DataSinkExec`: one 
single-partition input, one commit, one `count` row. Using `DataSinkExec` with 
an `IcebergCommitSink` removes the duplicated plan-node code and picks up what 
`DataSinkExec` provides (input null checks, cooperative scheduling, metrics 
forwarding, protobuf hooks).
   
   `IcebergWriteExec` stays a separate node, so writes still run in parallel 
and the commit runs once.
   
   ## What changes are included in this PR?
   
   - `IcebergCommitExec` is replaced by `IcebergCommitSink`, a `DataSink` whose 
`write_all` decodes the data files and commits them in one `fast_append`. It 
keeps the `table()` and `catalog()` getters.
   - `insert_into` builds `DataSinkExec::new(coalesced_write, 
Arc::new(IcebergCommitSink::new(table, catalog)), None)`.
   - The sink's errors are execution errors rather than internal ones, which 
DataFusion reports as DataFusion bugs.
   
   ## Are these changes tested?
   
   Yes. Unit tests in `write/commit.rs` cover a commit of several payloads, an 
empty insert, an empty payload, a wrong input and the plan display. The 
partitioned-source test moves to `tests/insert_into.rs` and now runs the 
insert. `tests/plan_nodes.rs` rebuilds the commit from the sink's getters.
   
   ## Are there any user-facing changes?
   
   - **Breaking:** `IcebergCommitExec` is removed. Code that builds or matches 
it uses `DataSinkExec` and downcasts `DataSinkExec::sink()` to 
`IcebergCommitSink`.
   - `DataSinkExec` reads only partition 0 of its input and, unlike 
`IcebergCommitExec`, doesn't check the partition count. Plans from 
`insert_into` or the optimizer are unaffected; a hand-built plan must coalesce 
the write itself.
   - `EXPLAIN` shows `DataSinkExec: sink=IcebergCommitSink(table=...)`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to