One of the field names in my JSON is "User-Agent". KSQL doesn't like the dash when I try to create a stream with that field name. I've tried single, double quotes, escaping it various ways--no luck.
How do I get that field from json in a topic to be in a KSQL stream?
Here's a log of some of my attempts:
ksql> create stream tmpstream (startTimeEpoch bigint, type VARCHAR, src VARCHAR, 'user-agent' varchar) with (KAFKA_TOPIC='foo', VALUE_FORMAT='JSON');
line 1:76: extraneous input ''user-agent'' expecting {'ADD', ...}
ksql> create stream tmpstream (startTimeEpoch bigint, type VARCHAR, src VARCHAR, user-agent varchar) with (KAFKA_TOPIC='foo', VALUE_FORMAT='JSON');
line 1:80: extraneous input '-' expecting {'ADD', ...}
ksql> create stream tmpstream (startTimeEpoch bigint, type VARCHAR, src VARCHAR, "user-agent" varchar) with (KAFKA_TOPIC='foo', VALUE_FORMAT='JSON');
Message
----------------
Stream created
----------------
ksql> select * from tmpstream;
Code generation failed for SelectValueMapper
Caused by: Line 1, Column 15: Expression "TMPSTREAM_user" is not an rvalue
ksql> drop stream tmpstream;
Message
--------------------------------
Source TMPSTREAM was dropped.
--------------------------------
ksql> create stream tmpstream (startTimeEpoch bigint, type VARCHAR, src VARCHAR, "user\-agent" varchar) with (KAFKA_TOPIC='foo', VALUE_FORMAT='JSON');
Message
----------------
Stream created
----------------
ksql> select * from tmpstream;
Code generation failed for SelectValueMapper
Caused by: Line 1, Column 15: Expression "TMPSTREAM_user" is not an rvalue