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

Flink Jira Bot updated FLINK-15965:
-----------------------------------
    Labels: stale-minor  (was: )

> 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: Minor
>              Labels: stale-minor
>
> 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)

Reply via email to