[feature-#1353][kafka-connector] add value deocder#1371
Merged
FlechazoW merged 4 commits intoDTStack:masterfrom Nov 3, 2022
Merged
[feature-#1353][kafka-connector] add value deocder#1371FlechazoW merged 4 commits intoDTStack:masterfrom
FlechazoW merged 4 commits intoDTStack:masterfrom
Conversation
3 tasks
FlechazoW
reviewed
Nov 3, 2022
Comment on lines
83
to
89
| if (DEFAULT_CODEC.defaultValue().equals(kafkaConf.getCodec())) { | ||
| this.decode = new JsonDecoder(); | ||
| this.decoder = new JsonDecoder(); | ||
| } else if (VALUE_CODEC.defaultValue().equals(kafkaConf.getCodec())) { | ||
| this.decoder = new ValueDecoder(); | ||
| } else { | ||
| this.decode = new TextDecoder(); | ||
| this.decoder = new TextDecoder(); | ||
| } |
Member
There was a problem hiding this comment.
Is using the 'switch-case' struct better?
Contributor
Author
There was a problem hiding this comment.
agree . I will make a change
Contributor
Author
There was a problem hiding this comment.
'flink.configuration.ConfigOption.defaultValue' is not a constant expression. so It can't be written after case.like this
case DEFAULT_CODEC.defaultValue:
this.decoder = decoder
So I change DEFAULT_CODEC type from flink.configuration.ConfigOption to String
FlechazoW
reviewed
Nov 3, 2022
Comment on lines
94
to
100
| if (DEFAULT_CODEC.defaultValue().equals(kafkaConf.getCodec())) { | ||
| this.decode = new JsonDecoder(); | ||
| this.decoder = new JsonDecoder(); | ||
| } else if (VALUE_CODEC.defaultValue().equals(kafkaConf.getCodec())) { | ||
| this.decoder = new ValueDecoder(); | ||
| } else { | ||
| this.decode = new TextDecoder(); | ||
| this.decoder = new TextDecoder(); | ||
| } |
Member
|
Nice contribution! |
Paddy0523
approved these changes
Nov 3, 2022
Contributor
|
+1 |
Contributor
Author
|
valueDecoderTest already done! |
Contributor
Author
|
@FlechazoW already done! cc |
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.
Add value decoder, for the purpose that we only need value
Which issue you fix
#1353
Checklist: