You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Konstantin Knauf (Jira)" <ji...@apache.org> on 2021/07/29 07:36:09 UTC

[jira] [Updated] (FLINK-15965) DATE literal issue in static partition spec

     [ https://issues.apache.org/jira/browse/FLINK-15965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Knauf updated FLINK-15965:
-------------------------------------
      Labels:   (was: auto-closed)
    Priority: Not a Priority  (was: Minor)

> DATE literal issue in static partition spec
> -------------------------------------------
>
>                 Key: FLINK-15965
>                 URL: https://issues.apache.org/jira/browse/FLINK-15965
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.10.0
>            Reporter: Rui Li
>            Priority: Not a Priority
>
> Suppose I have a table with a DATE partition column. The following DML would fail:
> {noformat}
> Flink SQL> insert into foo partition (p1=date '2020-01-24') select ..., ...;
> [INFO] Submitting SQL update statement to the cluster...
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.IllegalArgumentException: not a literal: DATE '2020-01-24'
> {noformat}
> Not sure why {{DATE '2020-01-24'}} is not considered a literal. And changing it to a CAST doesn't work either:
> {noformat}
> Flink SQL> insert into foo partition (p1=cast('2020-01-24' as date)) select ...,...;
> [INFO] Submitting SQL update statement to the cluster...
> [ERROR] Could not execute SQL statement. Reason:
> org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "cast" at line 1, column 35.
> Was expecting one of:
>     "DATE" ...
>     "FALSE" ...
>     "INTERVAL" ...
>     "NULL" ...
>     "TIME" ...
>     "TIMESTAMP" ...
>     "TRUE" ...
>     "UNKNOWN" ...
>     <UNSIGNED_INTEGER_LITERAL> ...
>     <APPROX_NUMERIC_LITERAL> ...
>     <DECIMAL_NUMERIC_LITERAL> ...
>     <BINARY_STRING_LITERAL> ...
>     <QUOTED_STRING> ...
>     <PREFIXED_STRING_LITERAL> ...
>     <UNICODE_STRING_LITERAL> ...
>     <LBRACE_D> ...
>     <LBRACE_T> ...
>     <LBRACE_TS> ...
>     "+" ...
>     "-" ...
> {noformat}



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