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

Switch to Plain View
Hive, mail # user - Searching for a string off a group by query


+
Tharindu Mathew 2012-07-16, 20:56
Copy link to this message
-
Re: Searching for a string off a group by query
John Omernik 2012-07-17, 03:20
Not sure what you are trying to do, but you may want to check out the
array_contains function. Also, if you are using Hive 9 you can use the
concat_ws() function.  This is taken from a google search:

select concat_ws(‘.’, array(‘www’,’apache’,’org’)) from src limit 1;
www.apache.org

https://cwiki.apache.org/Hive/presentations.data/WhatsNewInHive090HadoopSummit2012BoF.pdf

On the array_contains:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-CollectionFunctions

boolean array_contains(Array<T>, value)Returns TRUE if the array contains
value

On Mon, Jul 16, 2012 at 3:56 PM, Tharindu Mathew <[EMAIL PROTECTED]>wrote:

> Hi everyone,
>
> I'd like to do $subject and was approaching it with the following query:
>
> select activityId, count(activityId), *find_in_set("CCC",
> collect_set(msgBody))* from ActivityStream group by activityId;
>
> But find_in_set doesn't seem to accept arrays. Is there a way to cast this
> string array into a string list or a string so I can conduct a search?
> Maybe, there's another way to do this.
>
> Thanks in advance.
>
> --
> Regards,
>
> Tharindu
>
> blog: http://mackiemathew.com/
>
>
+
Tharindu Mathew 2012-07-17, 09:32
+
John Omernik 2012-07-17, 13:01