trino icon indicating copy to clipboard operation
trino copied to clipboard

Support for reading TIMESTAMP WITH LOCAL TIME ZONE in Hive connector

Open zielmicha opened this issue 3 years ago • 0 comments

Description

Resolves #1240 by mapping Hive TIMESTAMP WITH LOCAL TIME ZONE to TIMESTAMP WITH TIME ZONE with UTC zone.

Mapping to UTC is a bit of a judgement call (see #1240), but I believe is better than the alternatives (like using session zones) and the direction Trino maintainers want to take (see e.g. #8680).

In addition to the new automated test, I have tested reading the timestamps from Parquet files. Notably, Hive Avro serde doesn't support TIMESTAMP WITH TIME ZONE.

Is this change a fix, improvement, new feature, refactoring, or other?

A new feature.

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Hive connector

How would you describe this change to a non-technical end user or system administrator?

Adds support for TIMESTAMP WITH TIME ZONE Trino type to Hive connector. This type is translated to TIMESTAMP WITH LOCAL TIME ZONE - a Hive type that represents an instant of time. There is no explicit time zone associated with Hive TIMESTAMP WITH LOCAL TIME ZONE, so Trino always chooses to represent them in UTC timezone.

Related issues, pull requests, and links

  • Resolves #1240

Documentation

(updated the existing mention of this type in docs, not sure if there are other places I should update)

( ) No documentation is needed. ( ) Sufficient documentation is included in this PR. ( ) Documentation PR is available with #prnumber. ( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required. ( ) Release notes entries required with the following suggested text:

# Section
* Hive connector: support for reading TIMESTAMP WITH LOCAL TIME ZONE values ({issue}`1240`)

zielmicha avatar Aug 10 '22 09:08 zielmicha