You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Sergey Shelukhin <se...@hortonworks.com> on 2014/09/17 23:26:00 UTC

Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

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

Review request for hive, Ashutosh Chauhan and John Pullokkaran.


Repository: hive-git


Description
-------

see jira


Diffs
-----

  ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
  ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
  ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 

Diff: https://reviews.apache.org/r/25754/diff/


Testing
-------


Thanks,

Sergey Shelukhin


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by John Pullokkaran <jp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/#review53986
-----------------------------------------------------------



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java
<https://reviews.apache.org/r/25754/#comment93862>

    Instead of these changes why don't you use FunctionRegistry.getTypeInfoForPrimitiveCategory(a,b)


- John Pullokkaran


On Sept. 17, 2014, 9:25 p.m., Sergey Shelukhin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25754/
> -----------------------------------------------------------
> 
> (Updated Sept. 17, 2014, 9:25 p.m.)
> 
> 
> Review request for hive, Ashutosh Chauhan and John Pullokkaran.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> see jira
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
>   ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
>   ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
> 
> Diff: https://reviews.apache.org/r/25754/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by Sergey Shelukhin <se...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/
-----------------------------------------------------------

(Updated Sept. 24, 2014, 10:07 p.m.)


Review request for hive, Ashutosh Chauhan and John Pullokkaran.


Repository: hive-git


Description
-------

see jira


Diffs (updated)
-----

  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java f17b93d 
  ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java 56e210d 
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
  ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
  ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
  serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java cc75491 

Diff: https://reviews.apache.org/r/25754/diff/


Testing
-------


Thanks,

Sergey Shelukhin


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by Sergey Shelukhin <se...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/
-----------------------------------------------------------

(Updated Sept. 24, 2014, 1:26 a.m.)


Review request for hive, Ashutosh Chauhan and John Pullokkaran.


Repository: hive-git


Description
-------

see jira


Diffs (updated)
-----

  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java f17b93d 
  ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java 56e210d 
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
  ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
  ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
  serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java cc75491 

Diff: https://reviews.apache.org/r/25754/diff/


Testing
-------


Thanks,

Sergey Shelukhin


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by John Pullokkaran <jp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/#review54185
-----------------------------------------------------------

Ship it!


Ship It!

- John Pullokkaran


On Sept. 19, 2014, 9:50 p.m., Sergey Shelukhin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25754/
> -----------------------------------------------------------
> 
> (Updated Sept. 19, 2014, 9:50 p.m.)
> 
> 
> Review request for hive, Ashutosh Chauhan and John Pullokkaran.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> see jira
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java f17b93d 
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java 006870c 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
>   ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
>   ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
>   serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java cc75491 
> 
> Diff: https://reviews.apache.org/r/25754/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by Sergey Shelukhin <se...@hortonworks.com>.

> On Sept. 20, 2014, 12:36 a.m., John Pullokkaran wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java, line 161
> > <https://reviews.apache.org/r/25754/diff/2/?file=698150#file698150line161>
> >
> >     Since DecimalUtility would give you widest type possible for numeric comparisons your tgtDT would always be func return type.
> >     
> >     am i wrong?

For compares, where we use tgtDT directly, it's ok because it causes no further widening of type later.
For numerics, we use tgtDT only as a guideline (i.e. if it's decimal we convert both arguments to decimal), prec/scale are not taken into account.
We'd need to take them into account if any functions were to narrow the type, probably. But that is never done.


- Sergey


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


On Sept. 19, 2014, 9:50 p.m., Sergey Shelukhin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25754/
> -----------------------------------------------------------
> 
> (Updated Sept. 19, 2014, 9:50 p.m.)
> 
> 
> Review request for hive, Ashutosh Chauhan and John Pullokkaran.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> see jira
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java f17b93d 
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java 006870c 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
>   ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
>   ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
>   serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java cc75491 
> 
> Diff: https://reviews.apache.org/r/25754/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by John Pullokkaran <jp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/#review54062
-----------------------------------------------------------



ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java
<https://reviews.apache.org/r/25754/#comment94010>

    Since DecimalUtility would give you widest type possible for numeric comparisons your tgtDT would always be func return type.
    
    am i wrong?


- John Pullokkaran


On Sept. 19, 2014, 9:50 p.m., Sergey Shelukhin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25754/
> -----------------------------------------------------------
> 
> (Updated Sept. 19, 2014, 9:50 p.m.)
> 
> 
> Review request for hive, Ashutosh Chauhan and John Pullokkaran.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> see jira
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java f17b93d 
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java 006870c 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
>   ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
>   ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
>   serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java cc75491 
> 
> Diff: https://reviews.apache.org/r/25754/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by Sergey Shelukhin <se...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/
-----------------------------------------------------------

(Updated Sept. 19, 2014, 9:50 p.m.)


Review request for hive, Ashutosh Chauhan and John Pullokkaran.


Repository: hive-git


Description
-------

see jira


Diffs (updated)
-----

  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java f17b93d 
  ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java 006870c 
  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
  ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
  ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
  serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/HiveDecimalUtils.java cc75491 

Diff: https://reviews.apache.org/r/25754/diff/


Testing
-------


Thanks,

Sergey Shelukhin


Re: Review Request 25754: HIVE-8111 CBO trunk merge: duplicated casts for arithmetic expressions in Hive and CBO

Posted by John Pullokkaran <jp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25754/#review53982
-----------------------------------------------------------



ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java
<https://reviews.apache.org/r/25754/#comment93860>

    Avoid CBO name in function. Its a generic function current consumer is CBO.


- John Pullokkaran


On Sept. 17, 2014, 9:25 p.m., Sergey Shelukhin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25754/
> -----------------------------------------------------------
> 
> (Updated Sept. 17, 2014, 9:25 p.m.)
> 
> 
> Review request for hive, Ashutosh Chauhan and John Pullokkaran.
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> see jira
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/RexNodeConverter.java PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java 6131d3d 
>   ql/src/test/queries/clientpositive/decimal_udf.q 591c210 
>   ql/src/test/results/clientpositive/decimal_udf.q.out c5c2031 
> 
> Diff: https://reviews.apache.org/r/25754/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>