You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Sukhendu Chakraborty <su...@gmail.com> on 2012/05/14 20:40:33 UTC

NaNs and Infinity support in HIVE?

Are NaNs and/or Infinity supported in HIVE? If yes, I wanted to know
how are NaNs and Infinity values represented in HDFS files to be
interpreted correctly in Hive.

When I do 'select 1/0 from tab', I get a text value, "Infinity".
However, when I enter "Infinity" v in my HDFS file represented by the
HIVE table (the column datatype of the table is int), and then do a
select, I get 'NULL' (and not Infinity).

I am working with HIVE 0.7.1.

Thanks,
-Sukhendu

Re: NaNs and Infinity support in HIVE?

Posted by Sukhendu Chakraborty <su...@gmail.com>.
Thanks Mark. Yes, my findings were similar. It looks like HIVE does
not distinguish between Infinity and NaNs.

-Sukhendu

On Thu, May 17, 2012 at 6:50 PM, Mark Grover <mg...@oanda.com> wrote:
> I did a test for this.
>
> If a NaN is inserted into a string column, the value is serialized as "Infinity" in HDFS. However, if it's inserted into an Integer column, it's serialized as 2147483647 or -2147483648 depending on whether the output is +infinity or -infinity.
>
> Mark
>
> ----- Original Message -----
> From: "Nanda Vijaydev" <na...@gmail.com>
> To: user@hive.apache.org
> Sent: Thursday, May 17, 2012 8:10:45 PM
> Subject: Re: NaNs and Infinity support in HIVE?
>
> Can you paste a sample line of your data on HDFS and which column you are trying to query?
>
>
> Thanks
> Nanda Vijaydev
>
>
> On Mon, May 14, 2012 at 11:40 AM, Sukhendu Chakraborty < sukhendu.chakraborty@gmail.com > wrote:
>
>
> Are NaNs and/or Infinity supported in HIVE? If yes, I wanted to know
> how are NaNs and Infinity values represented in HDFS files to be
> interpreted correctly in Hive.
>
> When I do 'select 1/0 from tab', I get a text value, "Infinity".
> However, when I enter "Infinity" v in my HDFS file represented by the
> HIVE table (the column datatype of the table is int), and then do a
> select, I get 'NULL' (and not Infinity).
>
> I am working with HIVE 0.7.1.
>
> Thanks,
> -Sukhendu

Re: NaNs and Infinity support in HIVE?

Posted by Mark Grover <mg...@oanda.com>.
I did a test for this.

If a NaN is inserted into a string column, the value is serialized as "Infinity" in HDFS. However, if it's inserted into an Integer column, it's serialized as 2147483647 or -2147483648 depending on whether the output is +infinity or -infinity.

Mark

----- Original Message -----
From: "Nanda Vijaydev" <na...@gmail.com>
To: user@hive.apache.org
Sent: Thursday, May 17, 2012 8:10:45 PM
Subject: Re: NaNs and Infinity support in HIVE?

Can you paste a sample line of your data on HDFS and which column you are trying to query? 


Thanks 
Nanda Vijaydev 


On Mon, May 14, 2012 at 11:40 AM, Sukhendu Chakraborty < sukhendu.chakraborty@gmail.com > wrote: 


Are NaNs and/or Infinity supported in HIVE? If yes, I wanted to know 
how are NaNs and Infinity values represented in HDFS files to be 
interpreted correctly in Hive. 

When I do 'select 1/0 from tab', I get a text value, "Infinity". 
However, when I enter "Infinity" v in my HDFS file represented by the 
HIVE table (the column datatype of the table is int), and then do a 
select, I get 'NULL' (and not Infinity). 

I am working with HIVE 0.7.1. 

Thanks, 
-Sukhendu 

Re: NaNs and Infinity support in HIVE?

Posted by Nanda Vijaydev <na...@gmail.com>.
Can you paste a sample line of your data on HDFS and which column you are
trying to query?

Thanks
Nanda Vijaydev

On Mon, May 14, 2012 at 11:40 AM, Sukhendu Chakraborty <
sukhendu.chakraborty@gmail.com> wrote:

> Are NaNs and/or Infinity supported in HIVE? If yes, I wanted to know
> how are NaNs and Infinity values represented in HDFS files to be
> interpreted correctly in Hive.
>
> When I do 'select 1/0 from tab', I get a text value, "Infinity".
> However, when I enter "Infinity" v in my HDFS file represented by the
> HIVE table (the column datatype of the table is int), and then do a
> select, I get 'NULL' (and not Infinity).
>
> I am working with HIVE 0.7.1.
>
> Thanks,
> -Sukhendu
>