Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> Typecasting arrays


+
Andre Araujo 2013-12-19, 06:17
+
Nitin Pawar 2013-12-19, 06:22
+
Andre Araujo 2013-12-19, 06:34
Copy link to this message
-
Re: Typecasting arrays
I normally set default value to 0 if its empty
On Thu, Dec 19, 2013 at 12:04 PM, Andre Araujo <[EMAIL PROTECTED]> wrote:

> Thanks, Nitin.
>
> More specifically, what about empty arrays? How can I convince Hive that
> an empty array -- array() -- has a type of array<bigint>?
>
> Thanks again!
> Andre'
>
>
> On 19 December 2013 17:22, Nitin Pawar <[EMAIL PROTECTED]> wrote:
>
>> from what I know, There is no direct way to type cast array directly as
>> of now. If its added now then well and good
>>
>> I normally typecast individual element of the array and then join them
>> back (mostly via udf).
>>
>> I will see if I can find that code
>>
>>
>> On Thu, Dec 19, 2013 at 11:47 AM, Andre Araujo <[EMAIL PROTECTED]>wrote:
>>
>>> Hi, all,
>>>
>>> Is there a way to typecast arrays in hive? What I want is that for a
>>> specific select, where I specify and empty array as the value for one of
>>> the columns, for Hive to treat the empty array as array<bigint>, instead of
>>> the default, which is array<string>.
>>>
>>> I searched the documentation but couldn't find any reference to casting
>>> arrays. I also tried a few different combinations of the CAST function, but
>>> neither worked for arrays.
>>>
>>> Thanks,
>>> Andre
>>>
>>> --
>>> André Araújo
>>> The Pythian Group - Australia - www.pythian.com
>>>
>>> Office (calls from within Australia): 1300 366 021 x1270
>>> Office (international): +61 2 8016 7000  x270 *OR* +1 613 565 8696
>>> x1270
>>> Mobile: +61 410 323 559
>>> Fax: +61 2 9805 0544
>>> IM: pythianaraujo @ AIM/MSN/Y! or [EMAIL PROTECTED] @ GTalk
>>>
>>> “Success is not about standing at the top, it's the steps you leave
>>> behind.” — Iker Pou (rock climber)
>>>
>>> --
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Nitin Pawar
>>
>
>
>
> --
> André Araújo
> Database Administrator / SDM
>
> The Pythian Group - Australia - www.pythian.com
>
> Office (calls from within Australia): 1300 366 021 x1270
> Office (international): +61 2 8016 7000  x270 *OR* +1 613 565 8696   x1270
> Mobile: +61 410 323 559
> Fax: +61 2 9805 0544
> IM: pythianaraujo @ AIM/MSN/Y! or [EMAIL PROTECTED] @ GTalk
>
> “Success is not about standing at the top, it's the steps you leave behind.”
> — Iker Pou (rock climber)
>
> --
>
>
>
>
--
Nitin Pawar