Hi chenchun,
About the second part of your question, I agree that we should change
it. I checked MySQL and it returns the same type as was sent to the
round function.
I created https://issues.apache.org/jira/browse/HIVE-4174 to track
this. It's presently assigned to me but if you like to contribute a
patch (along with updated tests), please feel free to steal it from
me.

Mark

On Thu, Mar 14, 2013 at 12:44 AM, chenchun <chenchun.f...@gmail.com> wrote:
> Hi,
> I have a question about HIVE-3675 NaN does not work correctly for round(n).
> The issue did solve the NaN problem, but the hql below result in a different
> display with hive0.10.
> I checked the code UDFRound.java, found the function "LongWritable
> evaluate(DoubleWritable n)" changed to "DoubleWritable
> evaluate(DoubleWritable n) ".
> I think it maybe better to add a "LongWritable evaluate(LongWritable n)"
> function and modify the toString function of LongWritable that could solve
> the problem.
>
>
> select round(1234560), round(12345670) from test limit 1;
>
> //hive 0.10
> 1234560.0  1.234567E7
>
> //hive 0.9
> 1234560     12345670
>
> select round(cast(1234560 as BIGINT)), round(cast(12345670 as BIGINT)) from
> test limit 1;
>
> //hive 0.10
> 1234560.0  1.234567E7
>
>
> regards,
> chenchun
>

Reply via email to