You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Aihua Xu <ax...@cloudera.com> on 2017/01/17 15:02:47 UTC

Review Request 55623: HIVE-15617: Improve the avg performance for Range based window

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

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


Re: Review Request 55623: HIVE-15617: Improve the avg performance for Range based window

Posted by Yongzhi Chen <yc...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55623/#review162147
-----------------------------------------------------------


Ship it!




Ship It!

- Yongzhi Chen


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
> 
>


Re: Review Request 55623: HIVE-15617: Improve the avg performance for Range based window

Posted by Yongzhi Chen <yc...@cloudera.com>.

> On Jan. 17, 2017, 3:46 p.m., Yongzhi Chen wrote:
> >

Could you add a test case which range size is 0 for avg ?


- Yongzhi


-----------------------------------------------------------
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
> 
>


Re: Review Request 55623: HIVE-15617: Improve the avg performance for Range based window

Posted by Aihua Xu <ax...@cloudera.com>.

> 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
> 
>


Re: Review Request 55623: HIVE-15617: Improve the avg performance for Range based window

Posted by Aihua Xu <ax...@cloudera.com>.

> On Jan. 17, 2017, 3:46 p.m., Yongzhi Chen wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/BasePartitionEvaluator.java, line 132
> > <https://reviews.apache.org/r/55623/diff/1/?file=1606557#file1606557line132>
> >
> >     Is that possible sum is not null, numRows == 0 ?

I was also thinking about that. :) I checked the logic. Seems if numRows == 0, then sum should be null. We shouldn't run into sum / 0 situation.


- 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
> 
>


Re: Review Request 55623: HIVE-15617: Improve the avg performance for Range based window

Posted by Yongzhi Chen <yc...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55623/#review161875
-----------------------------------------------------------




ql/src/java/org/apache/hadoop/hive/ql/udf/ptf/BasePartitionEvaluator.java (line 132)
<https://reviews.apache.org/r/55623/#comment233154>

    Is that possible sum is not null, numRows == 0 ?


- Yongzhi Chen


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
> 
>