-
Type:
Bug
-
Status: Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.11.1
-
Fix Version/s: 1.11.2
-
Component/s: Connectors / FileSystem, Table SQL / Ecosystem
-
Labels:
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
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")
It throws the following exception
Exception in thread "main" org.apache.flink.table.api.ValidationException: The field count of logical schema of the table does not match with the field count of physical schema
. The logical schema: [STRING,ROW<`lastUpdateTime` BIGINT, `transId` STRING>]
The physical schema: [STRING,ROW<`lastUpdateTime` BIGINT, `transId` STRING>,STRING].
The reason is that FileSystemTableFactory#createTableSource should use schema excluded computed column, not the original catalog table schema.