We have the following problem while using Flink SQL: we have configured Kafka Twitter connector to add tweets to Kafka and we want to read the tweets from Kafka in a table using Flink SQL.
How can we define nested json properties (including arrays) using Flink SQL API ?
We have tried the following, but it does not work (the values returned are empty):
CREATE TABLE kafka_tweets(
payload ROW(`HashtagEntities` ARRAY[VARCHAR])
) WITH (
'connector' = 'kafka',
'topic' = 'twitter_status',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'testGroup',
'scan.startup.mode' = 'earliest-offset',
'format' = 'json'
)
In the twitter response HashtagEntities is an array of objects.