Open
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What has changed
The current connector version doesn't support setting sink.properties.* per table. That defeats the purpose of having multiple topics in the same connector, which is very good in a multi-tenant environment.
This PR aims to change that by creating a new config prefix and connector (StarRocksSinkConnectorV2), avoiding breaking changes.
How it works
The solution uses a different approach compared to the original Sink as the properties are tied to the Load Manager.
Sink Properties
The properties are captured by using the following regex pattern:
sink\.table\.(.+)\.properties\.(.+). That will capture properties likesink.table.my_table.properties.columns.The properties are constructed by merging the default properties coming from the
sink.properties.*, so if the default properties set has acolumnsproperty it would be replaced by the example above.Load Manager
A Load Manager will be created for each table found when mapping the properties.
The
putmethod will find the correct Load Manager by using the topic to table mapping, fallbacking to the default loader if not found.The
preCommitmethod will flush all Load Managers and abort on the first chance of exception.