hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang" <xzh...@cloudera.com>
Subject Re: Review Request 16329: HIVE-6039: Round, AVG and SUM functions reject char/varch input while accepting string input
Date Thu, 19 Dec 2013 23:31:52 GMT


> On Dec. 19, 2013, 6:54 a.m., Prasad Mujumdar wrote:
> > The patch overall looks fine to. A minor suggestion below.
> > 
> > I am wondering if the string value (string, char or varchar) is in the decimal format
(scientific or non-scientific), the converting to double won't work. Do you think it's better
to convert the string values to decimal in all these cases ?
> > If not, it might be helpful to document that behavior.
> >

In hive, String type used in the numeric context is consistently converted to double, an approximate
type. If scientific number cannot be converted, that should be solved in a separate JIRA.
I don't think we should convert an approximate type to an exact type which is the principle
that Hive is following.


> On Dec. 19, 2013, 6:54 a.m., Prasad Mujumdar wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFRound.java, line 151
> > <https://reviews.apache.org/r/16329/diff/1/?file=398948#file398948line151>
> >
> >     I do agree that "Only numeric data types allowed" is a bit misleading since
we do support string types as well ..
> 
> Xuefu Zhang wrote:
>     Guys, I appreciated your feedback. However, your comment is about the code that I
didn't change. If you feel like that a change is needed, I guess a different JIRA is more
appropriate. Thanks.
> 
> Prasad Mujumdar wrote:
>     that's true. This is all these issues were applicable to STRING type as well.
>     A followup jira would be helpful, especially to consider decimal conversion for string
types. Thanks!

Okay. I will create a JIRA for this.


- Xuefu


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


On Dec. 17, 2013, 9:26 p.m., Xuefu Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/16329/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2013, 9:26 p.m.)
> 
> 
> Review request for hive and Prasad Mujumdar.
> 
> 
> Bugs: HIVE-6039
>     https://issues.apache.org/jira/browse/HIVE-6039
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Allow input to these UDFs for char and varchar.
> 
> 
> Diffs
> -----
> 
>   data/files/char_varchar_udf.txt PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFAverage.java 4b219bd 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFSum.java 41d5efd 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFRound.java fc9c1b2 
>   ql/src/test/queries/clientpositive/char_varchar_udf.q PRE-CREATION 
>   ql/src/test/results/clientpositive/char_varchar_udf.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/16329/diff/
> 
> 
> Testing
> -------
> 
> Unit tested. New test added. Test suite passed.
> 
> 
> Thanks,
> 
> Xuefu Zhang
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message