[ 
https://issues.apache.org/jira/browse/FLINK-23545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17393678#comment-17393678
 ] 

jinfeng commented on FLINK-23545:
---------------------------------

When I implement the code, I found a few problems.

After constructing the schema and some other attributes, I use `Catalog.of` 
method to create the CatalogTable which
is a DefaultCatalogTable.
```
CatalogTable.of(mergedSchema, tableComment, partitionKeys, mergedOptions);
```

But when parser a ddl like this
```
CREATE TABLE testCollection (
field1 VARCHAR
) with (
'connector' = 'COLLECTION'
)
```

COLLECTION is a legacy table, when generate the rel node,
First, it will execute the `isLegacySourceOptions(CatalogTable catalogTable, 
CatalogSchemaTable schemaTable)` method ,
it will throw the exception `"Only a resolved catalog table can be serialized 
into a map of string properties.`
Next it will create CatalogSourceTable to consturct the dynamic table.
As COLLECTION is a legacy table, so the job will throw `Unable to create a 
source for reading table` .

Also, I found the new TableDescriptor has the same problems, when use 
TableDescriptor consturct the legacy table with new style table options.

> Use new schema in SqlCreateTableConverter
> -----------------------------------------
>
>                 Key: FLINK-23545
>                 URL: https://issues.apache.org/jira/browse/FLINK-23545
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>            Reporter: jinfeng
>            Assignee: jinfeng
>            Priority: Major
>             Fix For: 1.14.0
>
>
> In order to support column comment in sql create table dll. We should  use 
> new schema in SqlCreateeTableConverter. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to