> On Jan. 17, 2017, 3:46 p.m., Yongzhi Chen wrote:
> >
> 
> Yongzhi Chen wrote:
>     Could you add a test case which range size is 0 for avg ?

We already have those kind of cases in existing test cases, for example, in 
windowing_windowspec3.q, 

select deptno, empno, bonus,
    avg(bonus) over (partition by deptno order by bonus range 200 preceding),
    avg(bonus) over (partition by deptno order by bonus range between 200 
preceding and 200 following),
    avg(bonus) over (partition by deptno order by bonus range between 200 
preceding and 100 preceding),
    avg(bonus) over (partition by deptno order by bonus range between 100 
following and 200 following),
    avg(bonus) over (partition by deptno order by bonus range between 200 
following and unbounded following),
    avg(bonus) over (partition by deptno order by bonus range between unbounded 
preceding and 200 following)
from emp

The range size for range between 200 preceding and 100 preceding, e.g, would be 
size 0 for the first row. So we have those test cases covered.


- Aihua


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55623/#review161875
-----------------------------------------------------------


On Jan. 17, 2017, 3:02 p.m., Aihua Xu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55623/
> -----------------------------------------------------------
> 
> (Updated Jan. 17, 2017, 3:02 p.m.)
> 
> 
> Review request for hive.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> HIVE-15617: Improve the avg performance for Range based window
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java 
> 5ad5c0628f19dabf17191c08e0b14f8e2b1391e8 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/BasePartitionEvaluator.java 
> f5f9f7bb8980636fa364001c5508c215b304b9eb 
> 
> Diff: https://reviews.apache.org/r/55623/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Aihua Xu
> 
>

Reply via email to