JunRuiLee opened a new pull request, #420:
URL: https://github.com/apache/paimon-rust/pull/420

   ### Purpose
   
   First PR of exposing PyPaimon's DataFrame write path to Rust. Refs #414.
   
   Exposes the Rust core's batch write loop through `bindings/python`:
   
   ```python
   wb = table.new_write_builder()
   write = wb.new_write()
   write.write_arrow(batch)            # PyArrow RecordBatch, may be called 
repeatedly
   messages = write.prepare_commit()
   wb.new_commit().commit(messages)    # persists a snapshot; readable via SQL
   ```
   
   `CommitMessage` (from `prepare_commit()`) is an opaque object passed back to 
`commit()` — same-process only for now; cross-process (pickle, for Ray 
worker→driver) is a later PR.
   
   Out of scope (later PRs): serializable `CommitMessage`, overwrite, 
pypaimon-side wiring.
   
   ### Notes
   
   - `write_arrow` validates the incoming batch schema against the table schema 
and raises `ValueError` on mismatch (names + types; binary/fixed_size_binary 
tolerated), mirroring pypaimon's `_validate_pyarrow_schema`. No implicit 
casting — callers supply correctly-typed batches (e.g. `INT` → Arrow `int32`).
   - A single `commit_user` is fixed per `WriteBuilder` and shared by 
`new_write()` and `new_commit()`, so the writer and committer agree (Paimon 
uses it for duplicate-commit detection).
   - `commit([])` (empty messages) is a no-op.
   
   ### Tests
   
   `bindings/python/tests/test_write.py` — 6 tests: write→commit→SQL read-back 
roundtrip, multi-batch, empty-commit no-op, schema-mismatch ValueError, 
non-message TypeError.


-- 
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]

Reply via email to