什么相当于配置单元中的 prestodb date_trunc
what is equivalent of prestodb date_trunc in hive
我有一个使用 DATE_TRUNC 的 prestodb 查询,如下所示:
DATE_TRUNC('week', DATE(dd.signup_timestamp))
它在 hive 中的等价物是什么?
另一个类似的问题是,这个表达式在 hive 中的 presto 等效于什么:
date_sub(date_trunc('week', now()), 180)
select date_sub('2018-09-05', cast(from_unixtime(unix_timestamp(), 'u') AS int)) as c;
output: 2018-09-03
其他的:
date_sub(date_sub(from_unixtimestamp(unix_timestamp(), cast(from_unixtime(unix_timestamp(), 'u'), 'u')as int)), 180)
我有一个使用 DATE_TRUNC 的 prestodb 查询,如下所示:
DATE_TRUNC('week', DATE(dd.signup_timestamp))
它在 hive 中的等价物是什么?
另一个类似的问题是,这个表达式在 hive 中的 presto 等效于什么:
date_sub(date_trunc('week', now()), 180)
select date_sub('2018-09-05', cast(from_unixtime(unix_timestamp(), 'u') AS int)) as c;
output: 2018-09-03
其他的:
date_sub(date_sub(from_unixtimestamp(unix_timestamp(), cast(from_unixtime(unix_timestamp(), 'u'), 'u')as int)), 180)