herbherbherb opened a new issue, #15768:
URL: https://github.com/apache/iceberg/issues/15768

   ### Feature Request / Improvement
   
   Adds a `PostCommitHook` plugin interface to `IcebergSink` that is invoked 
after each successful Iceberg commit. This enables use cases like updating 
table properties, triggering notifications, recording metrics, or synchronizing 
external metadata stores.
   
   ### Query Engine
   
   Flink
   
   ### Motivation
   
   After a successful Iceberg commit, users often need to perform additional 
operations (e.g., write watermark metadata to table properties, notify 
downstream systems, update external catalogs). Currently there is no extension 
point -- users must subclass `IcebergCommitter` and override `commit()`, which 
requires forwarding many constructor arguments through the subclass chain.
   
   This adds a `PostCommitHook` that is called after `operation.commit()` with 
the snapshot ID and snapshot summary. The hook runs in the committer's context 
and has access to all commit metadata.
   
   ### Changes
   
   - New: `PostCommitHook.java` -- `@FunctionalInterface` with a single method: 
`void afterCommit(long snapshotId, Map<String, String> summary)`
   - Modified: `IcebergCommitter` -- accepts optional hook, invokes it after 
successful commit
   - Modified: `IcebergSink.Builder` -- new `postCommitHook()` method, passed 
through to committer
   
   ### Compatibility
   
   - No behavioral change when the hook is not set (null default)
   - No changes to public API signatures of existing methods
   - Fully backward compatible
   
   ### Willingness to contribute
   
   - [x] I can contribute this improvement/feature independently
   - [x] I would be willing to contribute this improvement/feature with 
guidance from the Iceberg community
   - [ ] I cannot contribute this improvement/feature at this time


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