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

Switch to Plain View
Hive, mail # user - How to convert Array to String in Hive0.7


+
lxw 2013-06-14, 09:51
Copy link to this message
-
Re: How to convert Array to String in Hive0.7
Jan Dolinár 2013-06-14, 10:07
Hi,

I was facing the same problem few weeks ago. The final solution was quick
and dirty - I grabbed the code for this UDF from
http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFConcatWS.java?revision=1234150&view=markup&pathrev=1234150and
compiled it the same way as my other UDFs.

The only part that doesn't work with hive 0.7 is the argument type checking
in initialize() method because of serdeConstants were not available in this
version. The dirty part of the solution is that I just commented out all
but last two lines of this method and the serdeConstants import :-) As long
as you don't pass wrong arguments to it, it works fine, otherwise you get
an error at runtime, while proper code should refuse to even compile the
query.

On Fri, Jun 14, 2013 at 11:51 AM, lxw <[EMAIL PROTECTED]> wrote:

> Hi, all :
>
>     How to convert Array to String in Hive0.7?
>
>     concat_ws(string SEP, array<string>) Like concat_ws() above, but
> taking an array of strings. (as of Hive 0.9.0<https://issues.apache.org/jira/browse/HIVE-2203>)
>
>
>     this function was not supported,who can help me?
>
>
> thanks!
>
>
>
>
>
>
>
+
Stephen Sprague 2013-06-14, 16:06