KSQL appends _0 to name of oneof field

11 views
Skip to first unread message

wackazong

unread,
Jan 11, 2023, 3:36:16 AM1/11/23
to ksqldb-users
I have the following protobuf definition in the schema registry:

message Event {
  oneof tx_details {
    TxCreated tx_created = 1;
    TxPending tx_pending = 2;
  }
}

When I create a stream with 

CREATE STREAM IF NOT EXISTS events WITH (KAFKA_TOPIC = 'events', VALUE_FORMAT = 'PROTOBUF');

Then the oneof field has the name TX_DETAILS_0 and not TX_DETAILS

Why is that? When I take the statement from DESCRIBE events EXTENDED, remove the _0 from the name and create a new stream with it, the field TX_DETAILS is always null.

Where does this additional _0 in the field name come from? Why is it necessary?

Thanks for any pointers.


Reply all
Reply to author
Forward
0 new messages