You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Oliver Lee (Jira)" <ji...@apache.org> on 2023/01/25 23:01:00 UTC

[jira] [Created] (CALCITE-5499) BigQuery TIMESTAMP_TRUNC() not fully implemented

Oliver Lee created CALCITE-5499:
-----------------------------------

             Summary: BigQuery TIMESTAMP_TRUNC() not fully implemented
                 Key: CALCITE-5499
                 URL: https://issues.apache.org/jira/browse/CALCITE-5499
             Project: Calcite
          Issue Type: Bug
            Reporter: Oliver Lee


BigQuery documentation shows that TIMESTAMP_TRUNC supports an optional 3rd argument, time zone
Docs: [https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#timestamp_trunc]

 

The current implementation does not support that.

 
 
{{SELECT
  timestamp_value AS timestamp_value,
  TIMESTAMP_TRUNC(timestamp_value, WEEK(MONDAY), "UTC") AS utc_truncated,
  TIMESTAMP_TRUNC(timestamp_value, WEEK(MONDAY), "Pacific/Auckland") AS nzdt_truncated
FROM (SELECT TIMESTAMP("2017-11-06 00:00:00+12") AS timestamp_value);

-- Display of results may differ, depending upon the environment and time zone where this query was executed.
+-------------------------+-------------------------+-------------------------+
| timestamp_value         | utc_truncated           | nzdt_truncated          |
+-------------------------+-------------------------+-------------------------+
| 2017-11-05 12:00:00 UTC | 2017-10-30 00:00:00 UTC | 2017-11-05 11:00:00 UTC |
+-------------------------+-------------------------+-------------------------+}}



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