[jira] [Created] (FLINK-19281) LIKE cannot recognize full table path

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-19281) LIKE cannot recognize full table path

Shang Yuanchun (Jira)
Benchao Li created FLINK-19281:
----------------------------------

             Summary: LIKE cannot recognize full table path
                 Key: FLINK-19281
                 URL: https://issues.apache.org/jira/browse/FLINK-19281
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / API, Table SQL / Planner
    Affects Versions: 1.11.2
            Reporter: Benchao Li


for example, if we have a table whose full path is {{default_catalog.default_database.my_table1}}, and the following DDL will fail
{code:SQL}
create table my_table2
like default_catalog.default_database.my_table1
{code}
it will throw
{code:java}
Exception in thread "main" org.apache.flink.table.api.ValidationException: Source table '`default_catalog`.`default_database`.`default_catalog.default_database.my_table1`' of the LIKE clause not found in the catalog, at line 11, column 6
        at org.apache.flink.table.planner.operations.SqlCreateTableConverter.lambda$lookupLikeSourceTable$1(SqlCreateTableConverter.java:207)
        at java.util.Optional.orElseThrow(Optional.java:290)
        at org.apache.flink.table.planner.operations.SqlCreateTableConverter.lookupLikeSourceTable(SqlCreateTableConverter.java:207)
        at org.apache.flink.table.planner.operations.SqlCreateTableConverter.createCatalogTable(SqlCreateTableConverter.java:103)
        at org.apache.flink.table.planner.operations.SqlCreateTableConverter.convertCreateTable(SqlCreateTableConverter.java:83)
        at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:188)
        at org.apache.flink.table.planner.delegation.ParserImpl.convertSqlNodeToOperation(ParserImpl.java:92)
        at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlInternal(TableEnvironmentImpl.java:724)
        at org.apache.flink.table.api.internal.TableEnvironmentImpl.sql(TableEnvironmentImpl.java:704)
{code}

We can fix it in {{SqlCreateTableConverter#lookupLikeSourceTable}}, via using `SqlTableLike`'s full name.




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