Hive study notes: get the current time

Daily use of Oraclemore use sysdateto get the current time, use other databases now()can also be obtained.

impala introduction

impala is an MPP (massive parallel processing) SQL query engine for processing large amounts of data stored in Hadoop clusters.

It is an open source software written in C ++ and Java.

Compared with other Hadoop SQL engines, it provides high performance and low latency.

Unlike Apache Hive, Impala is not based on the MapReduce algorithm. It implements a distributed architecture based on daemons, which is responsible for all aspects of query execution running on the same machine. Therefore, it reduces the latency of using MapReduce, which makes Impala faster than Apache Hive.

Get current time

In impalathe execution now()through.

select now();
-- 2020-04-11 21:55:20.1365956333

In hivethe need to use unix_timestamp()get, but the return value is bigint UNIX timestamp format.

Thus utilizing the from_unixtime()conversion.

select from_unixtime(unix_timestamp(), 'yyyy-MM-dd HH:mm:ss')
-- 2020-04-11 21:58:00

Reference link: How does hive get the current time

Guess you like

Origin www.cnblogs.com/hider/p/12682538.html