Hunter Medney
04/12/2023, 7:32 PMHunter Medney
04/12/2023, 7:34 PM// perform CROSS JOIN UNNEST
Table queryTable = tableEnv.sqlQuery("...");
// build schema with cols from queryTable and add PK and watermarks
Schema schema = ...
// create new table from query with PK and watermark
DataStream<Row> queryStream = tableEnv.toDataStream(queryTable);
Table unnestedTable = tableEnv.fromDataStream(queryStream, schema);
// expose temporal table function
TemporalTableFunction temporalTableFunction = unnestedTable.createTemporalTableFunction($("row_time"), $("id"));
tableEnv.createTemporarySystemFunction("test", temporalTableFunction);