You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Rui Li (Jira)" <ji...@apache.org> on 2020/02/10 08:17:00 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 ]
Rui Li updated FLINK-15965:
---------------------------
Description:
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}
> 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
> Reporter: Rui Li
> Priority: 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)