[
https://issues.apache.org/jira/browse/CALCITE-5180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17637542#comment-17637542
]
Julian Hyde commented on CALCITE-5180:
--------------------------------------
I think that {{TIMESTAMP WITH LOCAL TIME ZONE}} is the best fit for
representing BQ {{TIMESTAMP}}. Especially if the database time zone is UTC.
The Oracle article should have strongly recommended that you use a database
time zone that has a fixed offset to UTC (i.e. no DST). If you do that, there
is a one-to-one correspondence between instants and {{TIMESTAMP WITH LOCAL TIME
ZONE}} values, and in fact converting from one to the other is involves
adding/subtracting a constant offset.
I don't know whether Calcite has a 'database time zone' concept (for
{{TIMESTAMP WITH LOCAL TIME ZONE}}). It has 'session time zone' concept but
that's different.
> Implement BigQuery functions for DATE, TIME, TIMESTAMP, DATETIME
> ----------------------------------------------------------------
>
> Key: CALCITE-5180
> URL: https://issues.apache.org/jira/browse/CALCITE-5180
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Will Noble
> Priority: Major
> Labels: pull-request-available
> Time Spent: 3h 20m
> Remaining Estimate: 0h
>
> Implement missing BigQuery functions for DATE, TIME, TIMESTAMP, DATETIME.
> Functions include:
> * CURRENT_DATE, CURRENT_DATETIME, CURRENT_TIME with timezone;
> * EXTRACT with time unit values WEEK(weekday), DATE, TIME;
> * various DATE, TIME, TIMESTAMP, DATETIME constructor functions;
> * DATE_ADD, DATETIME_ADD, TIME_ADD, TIMESTAMP_ADD;
> * DATE_SUB, DATETIME_SUB, TIME_SUB, TIMESTAMP_SUB;
> * DATE_DIFF, DATETIME_DIFF, TIME_DIFF, TIMESTAMP_DIFF;
> * DATE_TRUNC, DATETIME_TRUNC, TIME_TRUNC, TIMESTAMP_TRUNC;
> * LAST_DAY;
> * FORMAT_DATE, FORMAT_DATETIME, FORMAT_TIME, FORMAT_TIMESTAMP;
> * PARSE_DATE, PARSE_DATETIME, PARSE_TIME, PARSE_TIMESTAMP.
> The following functions are already implemented: CURRENT_DATETME,
> DATE(string), DATE_FROM_UNIX_DATE, TIMESTAMP_MICROS, TIMESTAMP_MILLIS,
> TIMESTAMP_SECONDS, UNIX_MICROS, UNIX_MILLIS, UNIX_SECONDS, UNIX_DATE.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)