I'm working on registering a DataStream as a Flink Table in StreamingTableEnvironment.
The syntax I'm using is like so:
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
tableEnv.createTemporaryView(
"foo",
dataStream,
$("f0").as("foo-id"),
$("f1").as("foo-value")
)
In this case "foo-id" and "foo-value" are primitive types. In the Datastream I also have Json objects that I would like to ideally register as a Row Type similar to the suggestion here for Flink CREATE TABLE command:
CREATE TABLE input(
id VARCHAR,
title VARCHAR,
properties ROW(`foo` VARCHAR)
) WITH (
'connector' = 'kafka-0.11',
'topic' = 'my-topic',
'properties.bootstrap.servers' = 'localhost:9092',
'properties.group.id' = 'python-test',
'format' = 'json'
);
See: Get nested fields from Kafka message using Apache Flink SQL
Is there a similar way to define nested types using Expressions?
I'm not registering streams using the Create Table command with connector because the data format is custom, which is why I resorted to registering a stream.