Jark Wu created FLINK-18665: ------------------------------- Summary: Filesystem connector should use TableSchema exclude computed columns Key: FLINK-18665 URL: https://issues.apache.org/jira/browse/FLINK-18665 Project: Flink Issue Type: New Feature Components: Connectors / FileSystem, Table SQL / Ecosystem Reporter: Jark Wu Fix For: 1.12.0, 1.11.2
This is reported in http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/How-to-use-a-nested-column-for-CREATE-TABLE-PARTITIONED-BY-td36796.html {code} create table navi ( a STRING, location ROW<lastUpdateTime BIGINT, transId STRING> ) with ( 'connector' = 'filesystem', 'path' = 'east-out', 'format' = 'json' ) CREATE TABLE output ( `partition` AS location.transId ) PARTITIONED BY (`partition`) WITH ( 'connector' = 'filesystem', 'path' = 'east-out', 'format' = 'json' ) LIKE navi (EXCLUDING ALL) tEnv.sqlQuery("SELECT type, location FROM navi").executeInsert("output") {code} The reason is that {{FileSystemTableFactory#createTableSource}} should use schema excluded computed column, not the original catalog table schema. [1]: https://github.com/apache/flink/blob/master/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/FileSystemTableFactory.java#L78 -- This message was sent by Atlassian Jira (v8.3.4#803005)