[
https://issues.apache.org/jira/browse/CALCITE-1947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16129652#comment-16129652
]
Julian Hyde commented on CALCITE-1947:
--------------------------------------
I don't think that {{TIMESTAMP WITH TIME ZONE}} data type is consistent with
that in the SQL standard. The standard type requires storing an extra 2 bytes
of information. So, I think we need to find another name for it.
PostgreSQL has a {{TIMESTAMP WITH TIME ZONE}} type similar to the one you
propose, but they're making the same mistake.
It seems better to follow what Oracle does. Your type is somewhat similar to
Oracle's {{TIMESTAMP WITH LOCAL TIME ZONE}}, except that Oracle converts such
timestamps to the database's local time zone, whereas this type would convert
to UTC. Oracle also has a {{TIMESTAMP WITH TIME ZONE}} type that has the
requisite extra 2 bytes and seems to be compliant with the standard.
If you think it is similar enough, we could call this {{TIMESTAMP WITH LOCAL
TIME ZONE}}. Can you research what other databases do?
Also, could you save some copy-paste by creating a common (package-protected,
abstract) base class for {{TimestampWithTimeZoneString}} and
{{TimestampString}}?
> Add time/timestamp with time zone types to optimizer
> ----------------------------------------------------
>
> Key: CALCITE-1947
> URL: https://issues.apache.org/jira/browse/CALCITE-1947
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Fix For: 1.14.0
>
>
> Implementation would be similar to PostgreSQL (the {{time/timestamp with
> timezone}} types do not store the timezone) and conversion from/to
> timezone-less types follows similar semantics.
> https://www.postgresql.org/docs/9.6/static/functions-datetime.html
> This would also allow us to integrate easily with Hive and Druid, which
> follow similar storage models/semantics for timestamp with timezone.
> Follow-up work will be needed to introduce these new types in Avatica and
> extend Calcite SQL parser.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)