-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Wrong encoding character inserted by KSQL (due to KSQL 5.0 limited to String as key format) #1865
Comments
it happens only with It works fine with |
Is there anyone take a look of this issue, it has been reported for a week. BTW, it happened during a POC in TD bank. |
Hi @larryxia-ddl, This is a little strange, as I would of expected it just to complain its not valid json. At the moment KSQL only support string keys. This is something we're aware of and its high up on our list of things to fix. So, I'm not surprised deserialising the keys to json isn't working, but the way its failing is unexpected. I'm guessing that While this does not explain why you're getting an invalid UTF-8 char from the any questions, let me know. Otherwise, if you're happy with the explanation, please close this issue. |
Thank you for the reply. Are you going to open a Jira for this issue. I didn't see there is anyplace mentioned this limitation in KSQL, and the exception thrown is really misleading. Even prsale from confluent didn't know this. It was a blocking issue until we found it works with StringConverter. BTW, the jsonconverter is the default key converter of Kafka Elasticsearch connector, so it has high chance that people meet this issue if they don't know this limitation or bug. |
The restrictions on the key format is documented here: https://docs.confluent.io/current/ksql/docs/syntax-reference.html#key-requirements The issue to track the enhancement to support structured key types is here: #824 |
I don't think it is same case. The key is "requesttype" which is varchar, it is a legal data type which ksql support. |
Hi @larryxia-ddl !
I think you're saying this because create table ktab4 with (KAFKA_TOPIC='poc.api.ktab4', VALUE_FORMAT='DELIMITED') as select requesttype, count(*) count from test1 window tumbling (size 5 minutes) group by requesttype; If so, see what @big-andy-coates wrote above:
(Note that Andy mixed up In other words, the So what to do next?
|
Thank you for the update. I am satisfied with this detailed explain. It will be great if It is mentioned in ksql document that we should use StringConvertor When trying move data from ksql topics to elastisearch. It has to be specified in the connector configuration explicitly . Because The default KeyConvertor is JsonConvertor. Larry |
I've raised an internal JIRA for our docs team to add this note re. use with Kafka Connect. |
During a POC, we defined a stream
test1
on topicpoc.api.internal
, then create a tablektab4
which aggregate data fromtest1
with a tumbling window for 5 minutes. Topicpoc.api.ktab4
was created by KSQL. We then create a Kafka to elasticsearch connector to dump data in topicpoc.api.ktab4
to elasticsearh. We also have another elasticsearch connector to dump data from toppoc.api.internal
to elasticsearch.When we pump date to
poc.api.internal
, we found we can dump original data to elasticsearch. But we can't dump the aggregated data frompoc.api.ktab4
to elasticsearch, The exception complains wrong encoding.Because there is no encoding issue in the original message, can we assume the encoding issue is introduced by KSQL.
Please advise how to avoid this issue.
The script to create the KSQL stream and table.
The exception
The message in
poc.api.internal
:The message in
poc.api.ktab4
:The text was updated successfully, but these errors were encountered: