Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature][kafka-connector] Does the codec in Kafka play the correct role #1353

Closed
3 tasks done
liumengkai opened this issue Oct 26, 2022 · 2 comments · Fixed by #1371
Closed
3 tasks done

[Feature][kafka-connector] Does the codec in Kafka play the correct role #1353

liumengkai opened this issue Oct 26, 2022 · 2 comments · Fixed by #1371
Labels
feature-request this is a feature requests on the product

Comments

@liumengkai
Copy link
Contributor

liumengkai commented Oct 26, 2022

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

Now the kafka sink has a parameter 'codec',It is set by default to 'json',chunjun use JsonDecoder to decode data,and JsonDecoder will return a map that key is 'message'. The data in kafka like this,2 columns value has been splited by ','

{"message":"1344696702,FE3FF851-1409-4621-80C5-8402D40119D0"}

When this parameter is set to 'text' , chunjun will use TextDecoder to decode data, but the TextDecoder will still return a map with 'message' as key. The data in kafka is still like this. It's also a json string

{"message":"1344696702,FE3FF851-1409-4621-80C5-8402D40119D0"}

When we set codec to 'text',I think what we want data in kafka is like this:

1344696702,FE3FF851-1409-4621-80C5-8402D40119D0

Just the value , not a json
How about this? I can make a pr about this change after we discuss.

Use case

When we only need value to sink to kafka not a json

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@liumengkai liumengkai added the feature-request this is a feature requests on the product label Oct 26, 2022
@FlechazoW
Copy link
Member

I think, if we want data with only value, we should create a new decoder.

@liumengkai
Copy link
Contributor Author

I think, if we want data with only value, we should create a new decoder.

agree .and I will make a try :-)

liumengkai added a commit to liumengkai/chunjun that referenced this issue Nov 2, 2022
liumengkai added a commit to liumengkai/chunjun that referenced this issue Nov 2, 2022
@FlechazoW FlechazoW linked a pull request Nov 3, 2022 that will close this issue
9 tasks
liumengkai added a commit to liumengkai/chunjun that referenced this issue Nov 3, 2022
liumengkai added a commit to liumengkai/chunjun that referenced this issue Nov 3, 2022
FlechazoW pushed a commit that referenced this issue Nov 3, 2022
* [feature-#1353][kafka-connector] add value deocder

* [feature-#1353][kafka-connector] fix complie error

* [feature-#1353][kafka-connector] add valuedecoder Test

* [feature-#1353][kafka-connector] replace if else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request this is a feature requests on the product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants