-
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
CREATE TABLE hangs with null key in the source topic #266
Comments
If indeed messages with null key are dropped as for KTable, could you give a way to select the key from values when creating the table ? Maybe that's the purpose of WITH KEY but I did not make it work. |
@math-g Yes, you are right. The reason you see the |
Ok thanks, I was able to make the SELECT FROM TABLE work. Interesting to see that the 'WITH kafka_topic' property works as input for CREATE and as output for CREATE AS SELECT. Do you also know if with Kafka Connect, you can apply a per table ValueToKey transformation ? That would be simpler overall. |
@math-g by default KSQL reads topic from the current offset. One exception is the Stream-Table join where the table will be read from the beginning.
For more details please refer to https://github.com/confluentinc/ksql/blob/0.1.x/docs/examples.md#examples |
Thanks, I already had set this variable, actually, it doesn't seem to work for the intermediary stream, for which the output topic only seem to receive the new messages. Ok I will await you reply about Kafka Connect. |
@math-g about Connect: It is possible to apply an SMT to populate or override the key in a message, but ValueToKey will duplicate the value into the key. Another SMT might work for a single table and specific fields in the value, but for more than 1 table probably requires a custom SMT. |
@hjafarpour hjafarpour : i am facing same issue, where SELECT * FROM table hanging. but CREATE STREAM ACCOUNT_INFO (id INTEGER, name varchar) WITH (kafka_topic='test-oracle-jdbc-ACCOUNTS', value_format='JSON'); stream, table selection hanging. can you please help me on this |
See #1405 - closing. |
I am trying to create tables from my own data via Connect / JDBC (JSON converted with default
/etc/kafka/connect-standalone.properties
) and it seems the Connect's output topic that I use as a source for the KSQL CREATE TABLE statement needs a key to make it work (I had to use a ValueToKey transform in Connect so the topic's key is not null). Otherwise, the table is created but the SELECT * FROM table hangs.I have also tried the WITH KEY option at table creation, without success. If I use CREATE STREAM I don't need this key.
Can you confirm or infirm this need of a key in the source topic for table creation ?
The text was updated successfully, but these errors were encountered: