2

我在 HIVE 中有以下查询,但它不起作用

SELECT
newcust.dt , aspen.Probe , newcust.direction , aspen.VLan , sum(newcust.npacket), sum(newcust.nbyte), sum(newcust.nbytetcp), sum(newcust.nbyteudp), sum(newcust.byte_unknown), sum(newcust.pack_unknown), sum(newcust.byte_web), sum(newcust.pack_web), sum(newcust.byte_webapp), sum(newcust.pack_webapp), sum(newcust.byte_residential), sum(newcust.pack_residential), sum(newcust.byte_download), sum(newcust.pack_download), sum(newcust.byte_news), sum(newcust.pack_news), sum(newcust.byte_mail), sum(newcust.pack_mail), sum(newcust.byte_db), sum(newcust.pack_db), sum(newcust.byte_routing), sum(newcust.pack_routing), sum(newcust.byte_encrypted), sum(newcust.pack_encrypted), sum(newcust.byte_office), sum(newcust.pack_office), sum(newcust.byte_vpn), sum(newcust.pack_vpn), sum(newcust.byte_tunneling), sum(newcust.pack_tunneling), sum(newcust.byte_others), sum(newcust.pack_others), sum(newcust.byte_remoteaccess), sum(newcust.pack_remoteaccess), sum(newcust.byte_streaming), sum(newcust.pack_streaming) , sum(newcust.byte_chat), sum(newcust.pack_chat), sum(newcust.byte_voip), sum(newcust.pack_voip), aspen.CustomerName, aspen.General_NetworkPriority, aspen.SLA_CIR, aspen.SLA_EIR
FROM
 newcust INNER JOIN  aspen ON(  aspen.Probe = newcust.numsonde AND  aspen.VLan = substring(newcust.name1,1,instr(newcust.name1, '_')-1) )
WHERE
  newcust.numsonde = '1'
  AND  newcust.direction = '0'
  AND  newcust.dt LIKE '2012-01-20-%%%%'
  AND  COALESCE(UNIX_TIMESTAMP(aspen.scd_end,'dd-MM-yyyy'),CAST(9999999999 AS BIGINT)) >= UNIX_TIMESTAMP(newcust.dt,'yyyy-MM-dd-HHmm')+cast((newcust.period * 360) as BIGINT)
  AND  UNIX_TIMESTAMP(aspen.scd_start,'dd-MM-yyyy') < UNIX_TIMESTAMP(newcust.dt,'yyyy-MM-dd-HHmm')+cast((newcust.period * 360) as BIGINT)
GROUP BY newcust.dt, aspen.Probe, newcust.direction, aspen.VLan, aspen.CustomerName, aspen.General_NetworkPriority, aspen.SLA_CIR, aspen.SLA_EIR, from_unixtime(UNIX_TIMESTAMP(newcust.dt,'yyyy-MM-dd-HHmm')+cast((newcust.period * 360) as BIGINT))

Hive 返回以下错误:

FAILED: SemanticException java.lang.reflect.UndeclaredThrowableException. But there is no other explaination about the root of the problem. 

您认为查询无效还是另一个“更深层次”的问题?

4

1 回答 1

0

确保将select 子句中的所有字段都包含在group by 子句中。

于 2013-11-13T07:12:02.483 回答