I was reading the Flink SQL docs and in the section on Create, I could not find anything that resembles CREATE VIEW AS SELECT
nor CTAS.
I looked a bit further and found the following:
As such, it seems like Flink SQL would allow you to imitate the capabilities of Create as Select, but without the convenience of automatically grabbing the schema of the source table.
In addition, I found that:
For example:
Table result = tableEnv.sqlQuery("SELECT product, amount FROM Orders WHERE product LIKE '%Rubber%'");
Now my question:
And based on the examples that I have seen this can likely be rephrased as:
Can you create as select inside an executeSql
statement.
In Flink SQL, there exist the known CREATE VIEW AS SELECT
since 1.11. In older versions, you'd need to resort to the table API as pointed out by you.