简体   繁体   中英

Timezone when reading orc in hive

I have the external hive table (stored as orc). I put orc file using PutORC processor in Nifi.

When I select from table using hive-cli, values in timestamp columns 3 hours less than in the orc file.

hive> desc transactions;
OK
host                    string                                      
id                      bigint                                      
type                    int                                         
time_                   timestamp   
hive> select id, time_ from transactions where id=9126893492;
OK
9126893492  2020-03-01 08:45:18

I check the contents of the orc file via pyarrow lib and result is: 2020-03-01 11:45:18

Are there any setting for hive to configuring timezones?

** I use hive 3.1.2 on centos 7. System's timezone - Europe/Moscow **

If there is no timezone in the timestamp itself, the host operating system's local time zone is used.

Either add the desired time zone to the timestamps or adjust the host OS's local tz to the desired tz.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM