Flink: Add extensibility support to IcebergSink for downstream composition#15316
Flink: Add extensibility support to IcebergSink for downstream composition#15316herbherbherb wants to merge 1 commit intoapache:mainfrom
Conversation
ad6447e to
3e34caa
Compare
|
The general approach is first make your change to the current version (2.1), then once that is merged, cherry pick to the other supported versions (separate PRs for each version). |
ack, thank you |
…ition (apache#15315) Add CommittableMetadata framework (marker interface, serializer, registry) allowing downstream to attach custom metadata to committables. Widen access modifiers on sink pipeline classes to enable downstream connector implementations to compose with Iceberg's existing sink infrastructure. All changes are additive with no behavioral changes to existing code paths.
3e34caa to
1c53254
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This PR still needs a review from the community please |
|
There are currently multiple changes for the IcebergSink. I don't think we would like to expose the internals of the Sink as it would bind us to these contracts which we would like to change in the near future. If you think this still would be a valuable addition, please prepare a proposal and start a dev list discussion around this. Thanks, |
Thank you Peter for the feedback. I'll close this PR. I've broken the approach into three smaller, focused PRs that add plugin hooks rather than exposing sink internals or changing access modifiers. Each adds a single
All three are backward compatible with no behavioral change when the hooks are not set. Happy to start a dev list discussion if you'd prefer that before reviewing the individual PRs, thank you. |
Summary
CommittableMetadataframework: a composition-based extension point allowing downstream toattach custom metadata to committables flowing through the sink pipeline
with (reference, wrap, delegate to) Iceberg's existing sink infrastructure
Resolves #15315.
Changes
New files (3, in both v2.0 and v2.1)
CommittableMetadata.java—Serializablemarker interface for custom metadataCommittableMetadataSerializer.java— serializer interface for metadataCommittableMetadataRegistry.java— global registry (downstream callsregister()beforesink creation)
Modified files (in both v2.0 and v2.1)
IcebergCommittable— public class, public accessors, optional@Nullable metadatafield,backward-compatible constructor chaining
IcebergCommittableSerializer— writes boolean metadata flag + delegates serializationIcebergCommitter— public class + constructorIcebergSinkWriter— public class + constructorIcebergWriteAggregator— public class + constructorIcebergSinkBuilder— public interfaceIcebergSink— protected constructor, protected getters, protectedBuilder()CachingTableSupplier— public class + constructorRowDataTaskWriterFactory— protected getters for spec/format/outputFileFactorySinkUtil— publiccheckAndGetEqualityFieldIds()Backward compatibility
IcebergCommittableconstructor chains withmetadata = null)Test plan
TestIcebergCommitterpassesTestIcebergSink*tests passdeserializes correctly