Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Searching for a string off a group by query


Copy link to this message
-
Re: Searching for a string off a group by query
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/
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB