You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "N Campbell (JIRA)" <ji...@apache.org> on 2017/01/06 14:43:58 UTC

[jira] [Created] (HIVE-15553) expression to compute running sum fails with Failed to breakup Windowing invocations into Groups

N Campbell created HIVE-15553:
---------------------------------

             Summary: expression to compute running sum fails with Failed to breakup Windowing invocations into Groups
                 Key: HIVE-15553
                 URL: https://issues.apache.org/jira/browse/HIVE-15553
             Project: Hive
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.1.0
            Reporter: N Campbell


The following statement will fail in Hive.Expecting to compute the following as is possible in Oracle, Db2, Teradata, ...

select c1,   sum ( sum ( c3 ) ) over ( order by c1 )  from certtext.tolap group by c1
Error: Error while compiling statement: FAILED: SemanticException Failed to breakup Windowing invocations into Groups. At least 1 group must only depend on input columns. Also check for circular dependencies.
Underlying error: org.apache.hadoop.hive.ql.parse.SemanticException: Line 1:18 Expression not in GROUP BY key 'c3'
SQLState:  42000
ErrorCode: 40000


Note: if you use the following statement it can encounter a Tez error when c1 is a char vs string type. 

select c1,  sum( c3 ), sum ( sum ( c3 ) ) over ( order by c1 )  from certtext.tolap group by c1 

C1	SUM(C3)	SUM(SUM(C3))OVER(ORDERBYC1)
AAA	50	50
BBB	20	70
CCC	30	100
DDD	40	140
<null>	50	190


Table definition
create table  if not exists TOLAP (RNUM int , C1 char(3), C2 char(2), C3 int, C4 int)
 ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' LINES TERMINATED BY '\n' 
 STORED AS textfile ;




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)