You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Narayana (JIRA)" <ji...@apache.org> on 2017/06/02 06:13:04 UTC

[jira] [Comment Edited] (HIVE-16789) Query with window function fails when where clause returns no records

    [ https://issues.apache.org/jira/browse/HIVE-16789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034193#comment-16034193 ] 

Narayana edited comment on HIVE-16789 at 6/2/17 6:12 AM:
---------------------------------------------------------

I have tested this on hive(1.0.1 and 1.2.1) and it fails on both. It appears that you are using hortonworks platform which (according to their website) comes with hadoop 2.7.3(same as ours) but hive version says 1.2.1+ . Not exactly sure what additional fixes/optimization went into this and how it differs from apache build(that we use)
Are you suggesting me to test it on latest apache GA release(v1.2.2) ?



was (Author: nbathula):
I have tested this on hive(1.0.1 and 1.2.1) and it fails on both.Moreover the hadoop version we are using is later version than yours(v2.7.3)
However, It appears that the version of hive you are using also similar version but from Hortonworks. Not sure if there is any differences between apache build vs Hortonworks. 
Could you please clarify to which version of hive/Hadoop upgrade you are suggesting here?

> Query with window function fails when where clause returns no records
> ---------------------------------------------------------------------
>
>                 Key: HIVE-16789
>                 URL: https://issues.apache.org/jira/browse/HIVE-16789
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 1.0.1, 1.2.1
>         Environment: OS: CentOS release 6.6 (Final)
> HDP: 2.7.3
> Hive: 1.0.1,1.2.1
>            Reporter: Narayana
>
> When outer where clause found no matching records, queries like these are failing
> {code}
> select 
> a,b,c,d,e,
> min(c) over (partition by a,b order by d rows between 1 preceding and current row) prev_c
> from
> (
> select '1234' a ,'abc' b,10 c,2 d,'test1' e
> union all 
> select '1234' a ,'abc' b,9 c,1 d,'test2' e
> union all
> select '1234' a ,'abc' b,11 c,3 d,'test2' e
> union all  
> select '1234' a ,'abcd' b,1 c,5 d,'test2' e
> union all 
> select '1234' a ,'abcd' b,6 c,9 d,'test1' e
> )X
> where e='test3'
> ;
> {code}
> Error:
> Error: java.lang.RuntimeException: Hive Runtime Error while closing operators: null
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.close(ExecReducer.java:295)
> 	at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:453)
> 	at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:392)
> 	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Unknown Source)
> 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1698)
> 	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: java.util.NoSuchElementException
> 	at java.util.ArrayDeque.getFirst(Unknown Source)
> 	at org.apache.hadoop.hive.ql.udf.generic.GenericUDAFMax$MaxStreamingFixedWindow.terminate(GenericUDAFMax.java:280)
> 	at org.apache.hadoop.hive.ql.udf.ptf.WindowingTableFunction.finishPartition(WindowingTableFunction.java:413)
> 	at org.apache.hadoop.hive.ql.exec.PTFOperator$PTFInvocation.finishPartition(PTFOperator.java:337)
> 	at org.apache.hadoop.hive.ql.exec.PTFOperator.closeOp(PTFOperator.java:95)
> 	at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:598)
> 	at org.apache.hadoop.hive.ql.exec.Operator.close(Operator.java:610)
> 	at org.apache.hadoop.hive.ql.exec.mr.ExecReducer.close(ExecReducer.java:287)
> 	... 7 more



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)