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

Switch to Threaded View
Pig, mail # user - How to CONCAT multiple expressions


Copy link to this message
-
Re: How to CONCAT multiple expressions
Dan Young 2012-07-12, 02:14
Try org.apache.pig.builtin.StringConcat

Dano
On Tuesday, July 10, 2012, Cdy Chen wrote:

> Hi all,
>
> I am a new comer here. I encounter a problem toady:
>
> Pig version: 0.10.0
>
> temp2 = LOAD '/pig/procedure/tzone' USING PigStorage(';');
> zone = FOREACH temp2
> {
>    a = STRSPLIT($0,'#',3);
>    product = STRSPLIT(a.$1,'-',2);
>    key = CONCAT((chararray)product.$1,(chararray)$7,(chararray)$6);
>    GENERATE
>
> key,product.$1,TRIM($10),TRIM($4),TRIM($7),TRIM($9),TRIM($8),TRIM($14),TRIM($1),TRIM($6);
> };
>
>  It still shows an error:
> ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1045:
> <line 21, column 9> Could not infer the matching function for
> org.apache.pig.builtin.CONCAT as multiple or none of them fit. Please use
> an explicit cast.
>
> Please help!
>
> Thanks!
> Chen
>