You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "godfrey he (Jira)" <ji...@apache.org> on 2022/04/12 04:00:00 UTC

[jira] [Commented] (FLINK-26761) Fix the cast exception thrown by PreValidateReWriter when insert into/overwrite a partitioned table.

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

godfrey he commented on FLINK-26761:
------------------------------------

[~zoucao] you are right, it's a bug. would you like to fix it ?

> Fix the cast exception thrown by PreValidateReWriter when insert into/overwrite a partitioned table.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-26761
>                 URL: https://issues.apache.org/jira/browse/FLINK-26761
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>            Reporter: zoucao
>            Priority: Major
>
> In `PreValidateReWriter#appendPartitionAndNullsProjects`, we should use
> {code:java}
> val names = sqlInsert.getTargetTableID.asInstanceOf[SqlIdentifier].names
> {code}
> to get the table name, instead of
> {code:java}
> val names = sqlInsert.getTargetTable.asInstanceOf[SqlIdentifier].names
> {code}
> when we execute the following sql:
> {code:java}
> insert into/overwrite table_name /*+ options(xxx) */ partition(xxx) select  {code}
> invoke `sqlInsert.getTargetTable` will get a SqlTableRef, which can not be cast to SqlIdentifier.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)