Yes, it's a bug. Seemed not handling properly with PRECEDING+PRECEDING or FOLLOWING+FOLLOWING cases.
Thanks, Navis 2015-01-18 4:40 GMT+09:00 DU DU <will...@gmail.com>: > Hi folks, > The window clause in Hive 0.13.* does not work for the following example > statement > > - BETWEEN 2 PRECEDING AND 1 PRECEDING > - BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING > > Is there a reported JIRA for this? If not, I'll create Jira for this. > Thanks, > Will > > jdbc:hive2://> SELECT name, dept_num, salary, > > . . . . . . .> MAX(salary) OVER (PARTITION BY dept_num ORDER BY > > . . . . . . .> name ROWS > > . . . . . . .> BETWEEN 2 PRECEDING AND 1 PRECEDING) win4_alter > > . . . . . . .> FROM employee_contract > > . . . . . . .> ORDER BY dept_num, name; > > 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: Window range invalid, start boundary is greater than end > boundary: window(start=range(2 PRECEDING), end=range(1 PRECEDING)) > (state=42000,code=40000) > > > > jdbc:hive2://> SELECT name, dept_num, salary, > > . . . . . . .> MAX(salary) OVER (PARTITION BY dept_num ORDER BY > > . . . . . . .> name ROWS > > . . . . . . .> BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) win1 > > . . . . . . .> FROM employee_contract > > . . . . . . .> ORDER BY dept_num, name; > > Error: Error while compiling statement: FAILED: SemanticException End of a > WindowFrame cannot be UNBOUNDED PRECEDING (state=42000,code=40000) >