[INLONG-6160][Sort] Support dynamic partition for KafkaLoadNode#6165
Merged
healchow merged 5 commits intoapache:masterfrom Oct 18, 2022
Merged
[INLONG-6160][Sort] Support dynamic partition for KafkaLoadNode#6165healchow merged 5 commits intoapache:masterfrom
healchow merged 5 commits intoapache:masterfrom
Conversation
gong
reviewed
Oct 14, 2022
...-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/KafkaLoadNode.java
Outdated
Show resolved
Hide resolved
gong
reviewed
Oct 14, 2022
...nectors/kafka/src/main/java/org/apache/inlong/sort/kafka/table/KafkaDynamicTableFactory.java
Outdated
Show resolved
Hide resolved
thesumery
reviewed
Oct 17, 2022
...-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/node/load/KafkaLoadNode.java
Outdated
Show resolved
Hide resolved
thesumery
approved these changes
Oct 17, 2022
EMsnap
approved these changes
Oct 17, 2022
healchow
reviewed
Oct 18, 2022
...tors/base/src/main/java/org/apache/inlong/sort/base/format/CanalJsonDynamicSchemaFormat.java
Outdated
Show resolved
Hide resolved
healchow
reviewed
Oct 18, 2022
...s/base/src/main/java/org/apache/inlong/sort/base/format/DebeziumJsonDynamicSchemaFormat.java
Outdated
Show resolved
Hide resolved
healchow
approved these changes
Oct 18, 2022
gong
approved these changes
Oct 18, 2022
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.
Prepare a Pull Request
(Change the title refer to the following example)
Title: [INLONG-6160][Sort] Support dynamic partition for KafkaLoadNode
(The following XYZ should be replaced by the actual GitHub Issue number)
Fixes #6160
Motivation
Support dynamic partition for KafkaLoadNode when the format of kafka is raw and the 'key.fields' is not specifyed.
This is mainly for some whole database migration scenarios, we assume that the upstream input data is a mixed schema of whole database migration, we ignore the real schema for now, receive the entire record in a binary raw data format, and fetch and parse its schema and data on the kafka sink side, and according to Some data values are dynamically written to related topic partitions.
Dynamic partition writing has some limitations:
1.The upstream data is raw format with a fixed inner format, only support [canal-json|debezium-json] at now
2.The 'key.fields' is not specifyed
3.It needs to specify 'sink.multiple.partition-pattern' and 'sink.multiple.format' for dynamically extracting partition from data
4.It will extract primary key from raw data as the partition key used hash if the 'sink.multiple.partition-pattern'
equals 'PRIMARY_KEY' else it will parse partition key from raw data.
Modifications
1.Add option of 'sink.multiple.partition-pattern'
2.Add partitioner of 'RawDataHashPartitioner'
3.Add method extractValues and extractPrimaryKeyNames and extractPrimaryKeyValues for the mode of 'DynamicSchemaFormat'
Verifying this change
(Please pick either of the following options)
This change is a trivial rework/code cleanup without any test coverage.
This change is already covered by existing tests, such as:
(please describe tests)
This change added tests and can be verified as follows:
(example:)
Documentation