LuciferYang opened a new issue, #1321:
URL: https://github.com/apache/paimon-rust/issues/1321

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/paimon-rust/issues) and found nothing 
similar.
   
   ### Motivation
   
   Table compaction is available in core through `Table::new_compact_builder()` 
(#1247, #1249) and in SQL through `CALL sys.compact` (#1312), but the Python 
binding has no entry point for it. A Python user who writes with `write-only = 
true`, or who needs merged results on an aggregation or partial-update table, 
has to build a `SQLContext` and run a SQL string to compact a table handle they 
already hold. This is the `trigger_compaction` part of #286.
   
   ### Solution
   
   Add `Table.new_compact_builder()` to the Python binding as a thin wrapper 
over the core builder, with the same flow as `CALL sys.compact`:
   
   ```python
   metrics = (
       table.new_compact_builder()
       .with_partition_filter({"method": "equal", "field": "dt", "literals": 
["2026-11-01"]})
       .with_commit_user("my-compactor")
       .execute()
   )
   ```
   
   - `with_partition_filter` takes the same predicate dicts as read filters. 
Repeated calls combine with AND.
   - `execute()` plans, runs every task and makes one `COMPACT` commit, then 
returns the task count and write metrics. Nothing is committed when no task is 
planned.
   - Errors from core, such as an unsupported table mode or lookup/DV 
compaction without `local-cache.enabled`, are raised as Python exceptions.
   
   ### Anything else?
   
   Part of #286. Snapshot expiration and orphan file cleanup from #286 are not 
included; #964 was closed as not planned for the Rust side.
   
   ### Willingness to contribute
   
   - [x] I'm willing to submit a PR!
   


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