shangxinli opened a new pull request, #776:
URL: https://github.com/apache/iceberg-cpp/pull/776

   ## Summary
   
   Adds the `iceberg::ReplacePartitions` class — the dynamic partition 
overwrite operation. Each `AddFile()` registers the file's partition for 
replacement of all existing data files in that partition. Produces an 
`overwrite` snapshot with `"replace-partitions"="true"` in the summary. 
Unpartitioned tables replace all existing data files.
   
   **This is PR1 of 2** for #637. See tracking issue #775 for the split 
rationale.
   
   ### What's in PR1
   - `iceberg::ReplacePartitions` class extending `SnapshotUpdate`:
     - Builder API: `AddFile`, `ValidateAppendOnly`, `ValidateFromSnapshot`, 
`ValidateNoConflictingData`, `ValidateNoConflictingDeletes`
     - `Apply` / `Summary` / `CleanUncommitted` overrides
     - Uses `ManifestFilterManager` for partition-based manifest filtering
   - `SnapshotSummaryFields::kReplacePartitions = "replace-partitions"` constant
   - `ReplacePartitions` forward declaration in `type_fwd.h`
   - CMake registration
   
   ### What's deferred to PR2
   - `Transaction::NewReplacePartitions()` API wiring on `Table` / `Transaction`
   - End-to-end test file (`replace_partitions_test.cc`)
   - Conflict-detection in `Validate()`: the `ValidateNoConflictingData` / 
`ValidateNoConflictingDeletes` builder methods currently set flags but the 
validation body is a no-op TODO. 
`MergingSnapshotUpdate::ValidateAddedDataFiles` / `ValidateNoNewDeleteFiles` 
are `protected` and require either exposing them or restructuring to extend 
`MergingSnapshotUpdate`. Left to PR2 to keep this PR focused.
   
   ### Design notes
   - Follows the Java `ReplacePartitions` semantics: operation type is 
`overwrite`, summary carries `"replace-partitions"="true"`.
   - Mirrors the existing C++ `FastAppend` / `MergeAppend` patterns (factory 
`Make()`, `SnapshotUpdate` base, builder error collector).
   - Unpartitioned table case handled in `Apply()` via 
`DeleteByRowFilter(AlwaysTrue())`.
   
   ## Test plan
   - [x] Clean build (`cmake --build build`) — 293/293 targets
   - [x] `clang-format` clean
   - [ ] End-to-end behavioral tests land in PR2 alongside the 
`Table`/`Transaction` API wiring
   
   Closes part of #637 (PR2 will close it).
   Tracking: #775


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