Raghunadh Nittala
03/03/2023, 4:11 AMmessage 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:
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.