Re: Does Flink 1.9 support create or replace views syntax in raw sql?
Posted by
kant kodali on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Does-Flink-1-9-support-create-or-replace-views-syntax-in-raw-sql-tp32256p33090.html
Hi Jingsong,
Can I store it in Local Filesystem/HDFS?
Thanks!
Hi Kant,
If you want your view persisted, you must to dock a catalog like hive catalog, it stores views in the metastore with mysql.
- In 1.10, you can store views in catalog through "Catalog.createTable", you can create a "CatalogViewImpl". This is an internal API, which is not easy to use.
- In 1.11, we will introduce create view DDL for "TableEnv.sqlUpdate" and "TableEnv.createView". It will be easy to use.
Best,
Jingsong Lee
Hi Kant,
The TableEnv#createTemporaryView and CREATE VIEW in SQL Cli both creates temporary views which is not persisted and will lost after session close.
I think the persisted views will be supported in 1.11.
Best,
Jark
Hi Jingsong,
Thanks a lot, I think I can live with TableEnvironment.createTemporaryView in Flink 1.10 (which I am expecting to be released this month) but are these views persisted somewhere? for example across sessions? or say I stop my application and start again will it work as expected?
Thanks!
Hi Kant,
Sorry, 1.10 not support "CREATE VIEW" in raw SQL too. Workaround is:
- Using TableEnvironment.createTemporaryView...
- Or using "create view" and "drop view" in the sql-client.
- Or using hive catalog, in 1.10, we support query catalog views.
FLIP-71 will be finished in 1.11 soon.
Best,
Jingsong Lee
I tried the following.
bsTableEnv.sqlUpdate("CREATE VIEW my_view AS SELECT * FROM sample1 FULL OUTER JOIN sample2 on sample1.f0=sample2.f0");
Table result = bsTableEnv.sqlQuery("select * from my_view");
It looks like
https://cwiki.apache.org/confluence/display/FLINK/FLIP-71+-+E2E+View+support+in+FLINK+SQL Views are not supported. Can I expect them to be supported in Flink 1.10?
Currently, with Spark SQL when the query gets big I break it down into views and this is one of the most important features my application relies on. is there any workaround for this at the moment?
Thanks!
Hi All,
Does Flink 1.9 support create or replace views syntax in raw SQL? like spark streaming does?
Thanks!
--
--