Vasily Melnik
Vasily Melnik

Reputation: 61

Hive 3.1 "timestamp with local time zone" problem

we try to use Hive 3.1.1 "timestamp with local time zone" feature, but when we try to create table like this:

create table t3
(ts timestamp with local time zone)
stored as parquet
location '/data/t3';

we get the error: java.lang.UnsupportedOperationException: Unknown field type: timestamp with local time zone('Europe/Moscow') i.e. Hive determine time zone correctly, but can not create table with such type of field.

How can we solve this problem?

Upvotes: 3

Views: 1596

Answers (1)

leftjoin
leftjoin

Reputation: 38335

Normalize timestamp (convert to UTC) using to_utc_timestamp

to_utc_timestamp(timestamp_column,'Europe/Moscow')

And store it as timestamp

Upvotes: 1

Related Questions