我在hive中执行CTAS查询,如下所述:
create table ps_agg
as select host, count(*) c, sum(l4_ul_throughput+l4_dw_throughput) usg from ops.isop
where
cast(cast(from_unixtime(begin_time) as TIMESTAMP) AS DATE) >= '2016-08-01' &
cast(cast(from_unixtime(begin_time) as TIMESTAMP) AS DATE) < '2016-09-01'
group by host;
host, begin_time, l4_ul_throughput
&amp; l4_dw_throughput
是ISOP表中的列。
我在运行此查询时收到的错误是:
Wrong arguments 'begin_time' : No matching method for class org.apache.hadoop.hive.ql.udf.UDFOPBitAnd with (string, timestamp).
begin_time
是表格中的int
类型。
我不知道出了什么问题。有人可以建议解决吗?
答案 0 :(得分:0)
解决了这个问题;这是一个语法错误。
更正了语法:
create table ps_agg
as select host, count(*) c, sum(l4_ul_throughput+l4_dw_throughput) usg from ops.isop
where
cast(cast(from_unixtime(begin_time) as TIMESTAMP) AS DATE) >= '2016-08-01' AND
cast(cast(from_unixtime(begin_time) as TIMESTAMP) AS DATE) < '2016-09-01'
group by host;