Hi Folks, I’m trying to use TableStream API with ‘...
# troubleshooting
r
Hi Folks, I’m trying to use TableStream API with ‘upsert-kafka’ connector to write some data to kafka topic. For this, I want to test out the queries by inserting some sample data. This is the proto for reference:
Copy code
message EventChanged {
  string id = 1;
  map<string, google.protobuf.Any> changes = 2;
}

message SampleRule {
  string event_type = 1;
  EventChanged change_events = 2;
}
Here are my queries:
Copy code
CREATE TABLE test_changes (
    message_key STRING NOT NULL,
    event_type STRING NOT NULL,
    event_changed ROW<id STRING, changes MAP<STRING, BYTES>>,
CONSTRAINT pk_test_changes PRIMARY KEY (message_key) NOT ENFORCED
) WITH (
    'connector' = 'upsert-kafka',
    'topic' = 'test-changes',
    'properties.bootstrap.servers' = 'localhost:9092',
    'key.format' = 'raw',
    'value.format' = 'protobuf',
    'value.protobuf.message-class-name' = 'TestProto$SampleRule',
    'value.fields-include' = 'EXCEPT_KEY'
);
My question is - Is the datatype BYTES correct for protobuf Any field? How can I prepare the data for these type of fields. I tried the statement, `INSERT INTO test_changes(message_key, event_type, event_changed) VALUES('abc123', 'efg', ROW('123', MAP['www', '123']));`but this didn’t work.