Han created FLINK-32958:
---------------------------

             Summary: Support VIEW as a source table in CREATE TABLE ... Like 
statement
                 Key: FLINK-32958
                 URL: https://issues.apache.org/jira/browse/FLINK-32958
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / Planner
    Affects Versions: 1.17.1
            Reporter: Han


We can't create a table from a view through CREATE TABLE LIKE statement

 

case 1:
{code:sql}
create view source_view as select id,val from source;
create table sink with ('connector' = 'print') like source_view (excluding all);
insert into sink select * from source_view;{code}
case 2
{code:java}
DataStreamSource<Entity> source = ...;
tEnv.createTemporaryView("source", source);
tEnv.executeSql("create table sink with ('connector' = 'print') like source 
(excluding all)");
tEnv.executeSql("insert into sink select * from source");{code}
 

The above cases will throw an exception:
{code:java}
Source table '`default_catalog`.`default_database`.`source`' of the LIKE clause 
can not be a VIEW{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to