[
https://issues.apache.org/jira/browse/CALCITE-6367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jerin John updated CALCITE-6367:
Description:
This issue is a followup on CALCITE-6269 that fixes some of Calcite's existing
format elements implementation to be aligned to BQ functionality. Two major
formats that might require a bit more rework is adding support for the TZH/TZM
elements along with time zone areas as described below:
* [Parsing timestamp
literals|https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_tz_as_string]
with timezones as used by BQ does not seem to be supported yet (format element
TZR is unimplemented, BQ has TZH, TZM for hour and minute offsets)
(eg: {{cast('2020.06.03 00:00:53+00' as timestamp format '.MM.DD
HH:MI:SSTZH')}}
* BQ format [timezone as string
|https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_tz_as_string]
can take an additional argument {{{}AT TIME ZONE 'Asia/Kolkata'{}}}, which
would require additional parser changes and time zone parameter to be plumbed
in to the cast operator call.
One important thing to consider, is that the {{SimpleDateFormat}} class which
currently stores the datetime object in {{{}CAST{}}}, may not fully support
timezone features as described and might warrant a broader refactoring of this
code to use timezone compatible data types.
was:
This issue is a followup on CALCITE-6269 that fixes some of Calcite's existing
format elements implementation to be aligned to BQ functionality. Two major
formats that might require a bit more rework is adding support for the TZH/TZM
elements along with time zone areas as described below:
* [Parsing timestamp
literals|https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_tz_as_string]
with timezones as used by BQ does not seem to be supported yet (format element
TZR is unimplemented, BQ has TZH, TZM for hour and minute offsets)
(eg: {{cast('2020.06.03 00:00:53+00' as timestamp format '.MM.DD
HH:MI:SSTZH')}}
* BQ format [timezone as string
|https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_tz_as_string]
can take an additional argument {{{}AT TIME ZONE 'Asia/Kolkata'{}}}, which
would require additional parser changes and time zone parameter to be plumbed
in to the cast operator call.
One important thing to consider, is that the {{SimpleDateFormat}} class which
currently stores the datetime object, may not fully support timezone features
as described and might warrant a broader refactoring of this code.
> Add timezone support for FORMAT clause in CAST (enabled in BigQuery)
>
>
> Key: CALCITE-6367
> URL: https://issues.apache.org/jira/browse/CALCITE-6367
> Project: Calcite
> Issue Type: Bug
>Reporter: Jerin John
>Priority: Major
>
> This issue is a followup on CALCITE-6269 that fixes some of Calcite's
> existing format elements implementation to be aligned to BQ functionality.
> Two major formats that might require a bit more rework is adding support for
> the TZH/TZM elements along with time zone areas as described below:
> * [Parsing timestamp
> literals|https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_tz_as_string]
> with timezones as used by BQ does not seem to be supported yet (format
> element TZR is unimplemented, BQ has TZH, TZM for hour and minute offsets)
> (eg: {{cast('2020.06.03 00:00:53+00' as timestamp format '.MM.DD
> HH:MI:SSTZH')}}
> * BQ format [timezone as string
> |https://cloud.google.com/bigquery/docs/reference/standard-sql/format-elements#format_tz_as_string]
> can take an additional argument {{{}AT TIME ZONE 'Asia/Kolkata'{}}}, which
> would require additional parser changes and time zone parameter to be plumbed
> in to the cast operator call.
> One important thing to consider, is that the {{SimpleDateFormat}} class which
> currently stores the datetime object in {{{}CAST{}}}, may not fully support
> timezone features as described and might warrant a broader refactoring of
> this code to use timezone compatible data types.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)