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

Julian Hyde commented on CALCITE-6021:
--------------------------------------

The test you have highlighted, {{{}SqlValidatorTest.testCurrentDatetime{}}}, 
should and does correctly fail. The BigQuery operator table is not enabled, and 
therefore the validator can't find the {{CURRENT_DATETIME}} function.

There should be another test that {{SELECT CURRENT_DATETIME}} is valid if you 
use the BQ parser and operator table.

The variable {{expectedError}} is not used in that test and should be removed. 
It is confusing for maintainers.

Somewhere - I'm not sure where - we should specify that {{CURRENT_DATETIME}} 
does not use parentheses when there are zero arguments, but does allow 
arguments. {{SqlSyntax.FUNCTION_ID}} is probably it.

> Add CURRENT_DATETIME function (enabled in BigQuery library)
> -----------------------------------------------------------
>
>                 Key: CALCITE-6021
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6021
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Tanner Clary
>            Priority: Major
>
> Calcite supports parsing and validation for the CURRENT_DATETIME function 
> according to CALCITE-4297 . However a native implementation was never added.
> The docs for the function may be found here: 
>  
> https://cloud.google.com/bigquery/docs/reference/standard-sql/datetime_functions#current_datetime
> An example:
> {{SELECT CURRENT_DATETIME([timezone])}} should return the current time as a 
> {{DATETIME}} (a Calcite TIMESTAMP). There is an optional time zone argument.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to