[
https://issues.apache.org/jira/browse/CALCITE-5352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
carton.swing updated CALCITE-5352:
----------------------------------
Description:
While using babel parser(calcite-babel's SqlBabelParserImpl) to parse
PostgreSQL syntax:
{code:java}
planner.parse("SELECT DATE_PART('week', TIMESTAMP '2022-10-31')"){code}
it will throws exception.
But if I use:
{code:java}
planner.parse("SELECT DATE_PART(week, TIMESTAMP '2022-10-31')"){code}
the parser works well.
However, the former syntax, which is a quote-string, is correct according to :
[https://www.postgresql.org/docs/9.1/functions-datetime.html]
|Note that here the {{field}} parameter needs to be a string value, not a name.
The valid field names for {{date_part}} are the same as for {{{}extract{}}}.
SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40');|
The first argument should be a a quote string instead of a TimeUnit token.
was:
While using babel parser(calcite-babel's SqlBabelParserImpl) to parse
PostgreSQL syntax:
{code:java}
planner.parse("SELECT DATE_PART('week', TIMESTAMP '2022-10-31')"){code}
it will throws exception.
But if I use:
{code:java}
planner.parse("SELECT DATE_PART(week, TIMESTAMP '2022-10-31')"){code}
the parser works well.
However, the former syntax, which is a quote-string, is correct according to :
[https://www.postgresql.org/docs/9.1/functions-datetime.html]
|Note that here the {{field}} parameter needs to be a string value, not a name.
The valid field names for {{date_part}} are the same as for {{{}extract{}}}.
SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40');|
the first argument should be a a quote string instead of a TimeUnit token.
Is there something I'm missing?
> Babel parser does not recogize quote string with DATE_PART function
> -------------------------------------------------------------------
>
> Key: CALCITE-5352
> URL: https://issues.apache.org/jira/browse/CALCITE-5352
> Project: Calcite
> Issue Type: Bug
> Reporter: carton.swing
> Priority: Major
>
> While using babel parser(calcite-babel's SqlBabelParserImpl) to parse
> PostgreSQL syntax:
> {code:java}
> planner.parse("SELECT DATE_PART('week', TIMESTAMP '2022-10-31')"){code}
> it will throws exception.
> But if I use:
> {code:java}
> planner.parse("SELECT DATE_PART(week, TIMESTAMP '2022-10-31')"){code}
> the parser works well.
>
> However, the former syntax, which is a quote-string, is correct according to
> : [https://www.postgresql.org/docs/9.1/functions-datetime.html]
> |Note that here the {{field}} parameter needs to be a string value, not a
> name. The valid field names for {{date_part}} are the same as for
> {{{}extract{}}}.
> SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40');|
> The first argument should be a a quote string instead of a TimeUnit token.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)