|
|
-
Concat multiple strings
Michael Lok 2012-01-19, 07:39
Hi folks,
Is there an another way to perform string concat on multiple columns instead of using the built in CONCAT function which only takes 2 arguments?
I can do CONCAT(str1, CONCAT(str2, str3)), but that's really stretching it if I have more than 4 fields :) Thanks!
+
Michael Lok 2012-01-19, 07:39
-
RE: Concat multiple strings
Marek Miglinski 2012-01-19, 15:53
Hi, You can use my custom UDF function called MassCONCAT, it is able to concat numerics, strings and tuples. Link: http://codeupload.com/4992Thanks, Marek M. ________________________________________ From: Michael Lok [[EMAIL PROTECTED]] Sent: Thursday, January 19, 2012 9:39 AM To: [EMAIL PROTECTED] Subject: Concat multiple strings Hi folks, Is there an another way to perform string concat on multiple columns instead of using the built in CONCAT function which only takes 2 arguments? I can do CONCAT(str1, CONCAT(str2, str3)), but that's really stretching it if I have more than 4 fields :) Thanks!
+
Marek Miglinski 2012-01-19, 15:53
-
Re: Concat multiple strings
Alan Gates 2012-01-19, 16:04
In Pig 0.9 and later CONCAT accepts more than two strings or bytearrays.
Alan.
On Jan 18, 2012, at 11:39 PM, Michael Lok wrote:
> Hi folks, > > Is there an another way to perform string concat on multiple columns > instead of using the built in CONCAT function which only takes 2 > arguments? > > I can do CONCAT(str1, CONCAT(str2, str3)), but that's really > stretching it if I have more than 4 fields :) > > > Thanks!
+
Alan Gates 2012-01-19, 16:04
-
Re: Concat multiple strings
Aniket Mokashi 2012-01-23, 01:43
Alan, I just noticed its Pig 0.8 and later. https://issues.apache.org/jira/browse/PIG-1420Am I missing something? Thanks, Aniket On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> wrote: > In Pig 0.9 and later CONCAT accepts more than two strings or bytearrays. > > Alan. > > On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: > > > Hi folks, > > > > Is there an another way to perform string concat on multiple columns > > instead of using the built in CONCAT function which only takes 2 > > arguments? > > > > I can do CONCAT(str1, CONCAT(str2, str3)), but that's really > > stretching it if I have more than 4 fields :) > > > > > > Thanks! > > -- "...:::Aniket:::... Quetzalco@tl"
+
Aniket Mokashi 2012-01-23, 01:43
-
Re: Concat multiple strings
Prashant Kommireddi 2012-01-23, 01:53
Aniket, if you read through the comments you would notice the feature was actually added in 0.9. The one in 0.8 had an issue. Thanks, Prashant Sent from my iPhone On Jan 22, 2012, at 5:44 PM, Aniket Mokashi <[EMAIL PROTECTED]> wrote: > Alan, I just noticed its Pig 0.8 and later. > https://issues.apache.org/jira/browse/PIG-1420> Am I missing something? > > Thanks, > Aniket > > On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> wrote: > >> In Pig 0.9 and later CONCAT accepts more than two strings or bytearrays. >> >> Alan. >> >> On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: >> >>> Hi folks, >>> >>> Is there an another way to perform string concat on multiple columns >>> instead of using the built in CONCAT function which only takes 2 >>> arguments? >>> >>> I can do CONCAT(str1, CONCAT(str2, str3)), but that's really >>> stretching it if I have more than 4 fields :) >>> >>> >>> Thanks! >> >> > > > -- > "...:::Aniket:::... Quetzalco@tl"
+
Prashant Kommireddi 2012-01-23, 01:53
-
Re: Concat multiple strings
Aniket Mokashi 2012-01-23, 06:37
Thanks Prashant. I just realized that! I thought we had it in 0.8, good stuff to know. :) Thanks, Aniket On Sun, Jan 22, 2012 at 5:53 PM, Prashant Kommireddi <[EMAIL PROTECTED]>wrote: > Aniket, if you read through the comments you would notice the feature > was actually added in 0.9. The one in 0.8 had an issue. > > Thanks, > Prashant > > Sent from my iPhone > > On Jan 22, 2012, at 5:44 PM, Aniket Mokashi <[EMAIL PROTECTED]> wrote: > > > Alan, I just noticed its Pig 0.8 and later. > > https://issues.apache.org/jira/browse/PIG-1420> > Am I missing something? > > > > Thanks, > > Aniket > > > > On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> > wrote: > > > >> In Pig 0.9 and later CONCAT accepts more than two strings or bytearrays. > >> > >> Alan. > >> > >> On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: > >> > >>> Hi folks, > >>> > >>> Is there an another way to perform string concat on multiple columns > >>> instead of using the built in CONCAT function which only takes 2 > >>> arguments? > >>> > >>> I can do CONCAT(str1, CONCAT(str2, str3)), but that's really > >>> stretching it if I have more than 4 fields :) > >>> > >>> > >>> Thanks! > >> > >> > > > > > > -- > > "...:::Aniket:::... Quetzalco@tl" > -- "...:::Aniket:::... Quetzalco@tl"
+
Aniket Mokashi 2012-01-23, 06:37
-
Re: Concat multiple strings
Michael Lok 2012-01-25, 02:19
Anyone tried using the CONCAT with >2 params using 0.9.1? I tried with 4 params and got the following error: Could not infer the matching function for org.apache.pig.builtin.CONCAT as multiple or none of them fit. Please use an explicit cast. On Mon, Jan 23, 2012 at 2:37 PM, Aniket Mokashi <[EMAIL PROTECTED]> wrote: > Thanks Prashant. I just realized that! > I thought we had it in 0.8, good stuff to know. :) > > Thanks, > Aniket > > On Sun, Jan 22, 2012 at 5:53 PM, Prashant Kommireddi <[EMAIL PROTECTED]>wrote: > >> Aniket, if you read through the comments you would notice the feature >> was actually added in 0.9. The one in 0.8 had an issue. >> >> Thanks, >> Prashant >> >> Sent from my iPhone >> >> On Jan 22, 2012, at 5:44 PM, Aniket Mokashi <[EMAIL PROTECTED]> wrote: >> >> > Alan, I just noticed its Pig 0.8 and later. >> > https://issues.apache.org/jira/browse/PIG-1420>> > Am I missing something? >> > >> > Thanks, >> > Aniket >> > >> > On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> >> wrote: >> > >> >> In Pig 0.9 and later CONCAT accepts more than two strings or bytearrays. >> >> >> >> Alan. >> >> >> >> On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: >> >> >> >>> Hi folks, >> >>> >> >>> Is there an another way to perform string concat on multiple columns >> >>> instead of using the built in CONCAT function which only takes 2 >> >>> arguments? >> >>> >> >>> I can do CONCAT(str1, CONCAT(str2, str3)), but that's really >> >>> stretching it if I have more than 4 fields :) >> >>> >> >>> >> >>> Thanks! >> >> >> >> >> > >> > >> > -- >> > "...:::Aniket:::... Quetzalco@tl" >> > > > > -- > "...:::Aniket:::... Quetzalco@tl"
+
Michael Lok 2012-01-25, 02:19
-
Re: Concat multiple strings
Prashant Kommireddi 2012-01-25, 03:02
Looks like a bug to me. I don't think "getArgToFuncMapping" is doing the right thing here. Thanks, Prashant On Tue, Jan 24, 2012 at 6:19 PM, Michael Lok <[EMAIL PROTECTED]> wrote: > Anyone tried using the CONCAT with >2 params using 0.9.1? I tried > with 4 params and got the following error: > > Could not infer the matching function for > org.apache.pig.builtin.CONCAT as multiple or none of them fit. Please > use an explicit cast. > > On Mon, Jan 23, 2012 at 2:37 PM, Aniket Mokashi <[EMAIL PROTECTED]> > wrote: > > Thanks Prashant. I just realized that! > > I thought we had it in 0.8, good stuff to know. :) > > > > Thanks, > > Aniket > > > > On Sun, Jan 22, 2012 at 5:53 PM, Prashant Kommireddi < > [EMAIL PROTECTED]>wrote: > > > >> Aniket, if you read through the comments you would notice the feature > >> was actually added in 0.9. The one in 0.8 had an issue. > >> > >> Thanks, > >> Prashant > >> > >> Sent from my iPhone > >> > >> On Jan 22, 2012, at 5:44 PM, Aniket Mokashi <[EMAIL PROTECTED]> > wrote: > >> > >> > Alan, I just noticed its Pig 0.8 and later. > >> > https://issues.apache.org/jira/browse/PIG-1420> >> > Am I missing something? > >> > > >> > Thanks, > >> > Aniket > >> > > >> > On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> > >> wrote: > >> > > >> >> In Pig 0.9 and later CONCAT accepts more than two strings or > bytearrays. > >> >> > >> >> Alan. > >> >> > >> >> On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: > >> >> > >> >>> Hi folks, > >> >>> > >> >>> Is there an another way to perform string concat on multiple columns > >> >>> instead of using the built in CONCAT function which only takes 2 > >> >>> arguments? > >> >>> > >> >>> I can do CONCAT(str1, CONCAT(str2, str3)), but that's really > >> >>> stretching it if I have more than 4 fields :) > >> >>> > >> >>> > >> >>> Thanks! > >> >> > >> >> > >> > > >> > > >> > -- > >> > "...:::Aniket:::... Quetzalco@tl" > >> > > > > > > > > -- > > "...:::Aniket:::... Quetzalco@tl" >
+
Prashant Kommireddi 2012-01-25, 03:02
-
RE: Concat multiple strings
Marek Miglinski 2012-01-25, 08:18
As far as I know, CONCAT can join chararrays, so if you are using CONCAT on chararray and tuple it will throw exception and ask to use explicit cast. Sincerely, Marek M. ________________________________________ From: Prashant Kommireddi [[EMAIL PROTECTED]] Sent: Wednesday, January 25, 2012 5:02 AM To: [EMAIL PROTECTED] Subject: Re: Concat multiple strings Looks like a bug to me. I don't think "getArgToFuncMapping" is doing the right thing here. Thanks, Prashant On Tue, Jan 24, 2012 at 6:19 PM, Michael Lok <[EMAIL PROTECTED]> wrote: > Anyone tried using the CONCAT with >2 params using 0.9.1? I tried > with 4 params and got the following error: > > Could not infer the matching function for > org.apache.pig.builtin.CONCAT as multiple or none of them fit. Please > use an explicit cast. > > On Mon, Jan 23, 2012 at 2:37 PM, Aniket Mokashi <[EMAIL PROTECTED]> > wrote: > > Thanks Prashant. I just realized that! > > I thought we had it in 0.8, good stuff to know. :) > > > > Thanks, > > Aniket > > > > On Sun, Jan 22, 2012 at 5:53 PM, Prashant Kommireddi < > [EMAIL PROTECTED]>wrote: > > > >> Aniket, if you read through the comments you would notice the feature > >> was actually added in 0.9. The one in 0.8 had an issue. > >> > >> Thanks, > >> Prashant > >> > >> Sent from my iPhone > >> > >> On Jan 22, 2012, at 5:44 PM, Aniket Mokashi <[EMAIL PROTECTED]> > wrote: > >> > >> > Alan, I just noticed its Pig 0.8 and later. > >> > https://issues.apache.org/jira/browse/PIG-1420> >> > Am I missing something? > >> > > >> > Thanks, > >> > Aniket > >> > > >> > On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> > >> wrote: > >> > > >> >> In Pig 0.9 and later CONCAT accepts more than two strings or > bytearrays. > >> >> > >> >> Alan. > >> >> > >> >> On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: > >> >> > >> >>> Hi folks, > >> >>> > >> >>> Is there an another way to perform string concat on multiple columns > >> >>> instead of using the built in CONCAT function which only takes 2 > >> >>> arguments? > >> >>> > >> >>> I can do CONCAT(str1, CONCAT(str2, str3)), but that's really > >> >>> stretching it if I have more than 4 fields :) > >> >>> > >> >>> > >> >>> Thanks! > >> >> > >> >> > >> > > >> > > >> > -- > >> > "...:::Aniket:::... Quetzalco@tl" > >> > > > > > > > > -- > > "...:::Aniket:::... Quetzalco@tl" >
+
Marek Miglinski 2012-01-25, 08:18
-
Re: Concat multiple strings
Michael Lok 2012-01-25, 09:21
Only chararrays are passed into CONCAT in this case. On Wed, Jan 25, 2012 at 4:18 PM, Marek Miglinski <[EMAIL PROTECTED]> wrote: > As far as I know, CONCAT can join chararrays, so if you are using CONCAT on chararray and tuple it will throw exception and ask to use explicit cast. > > > Sincerely, > Marek M. > ________________________________________ > From: Prashant Kommireddi [[EMAIL PROTECTED]] > Sent: Wednesday, January 25, 2012 5:02 AM > To: [EMAIL PROTECTED] > Subject: Re: Concat multiple strings > > Looks like a bug to me. I don't think "getArgToFuncMapping" is doing the > right thing here. > > Thanks, > Prashant > > On Tue, Jan 24, 2012 at 6:19 PM, Michael Lok <[EMAIL PROTECTED]> wrote: > >> Anyone tried using the CONCAT with >2 params using 0.9.1? I tried >> with 4 params and got the following error: >> >> Could not infer the matching function for >> org.apache.pig.builtin.CONCAT as multiple or none of them fit. Please >> use an explicit cast. >> >> On Mon, Jan 23, 2012 at 2:37 PM, Aniket Mokashi <[EMAIL PROTECTED]> >> wrote: >> > Thanks Prashant. I just realized that! >> > I thought we had it in 0.8, good stuff to know. :) >> > >> > Thanks, >> > Aniket >> > >> > On Sun, Jan 22, 2012 at 5:53 PM, Prashant Kommireddi < >> [EMAIL PROTECTED]>wrote: >> > >> >> Aniket, if you read through the comments you would notice the feature >> >> was actually added in 0.9. The one in 0.8 had an issue. >> >> >> >> Thanks, >> >> Prashant >> >> >> >> Sent from my iPhone >> >> >> >> On Jan 22, 2012, at 5:44 PM, Aniket Mokashi <[EMAIL PROTECTED]> >> wrote: >> >> >> >> > Alan, I just noticed its Pig 0.8 and later. >> >> > https://issues.apache.org/jira/browse/PIG-1420>> >> > Am I missing something? >> >> > >> >> > Thanks, >> >> > Aniket >> >> > >> >> > On Thu, Jan 19, 2012 at 8:04 AM, Alan Gates <[EMAIL PROTECTED]> >> >> wrote: >> >> > >> >> >> In Pig 0.9 and later CONCAT accepts more than two strings or >> bytearrays. >> >> >> >> >> >> Alan. >> >> >> >> >> >> On Jan 18, 2012, at 11:39 PM, Michael Lok wrote: >> >> >> >> >> >>> Hi folks, >> >> >>> >> >> >>> Is there an another way to perform string concat on multiple columns >> >> >>> instead of using the built in CONCAT function which only takes 2 >> >> >>> arguments? >> >> >>> >> >> >>> I can do CONCAT(str1, CONCAT(str2, str3)), but that's really >> >> >>> stretching it if I have more than 4 fields :) >> >> >>> >> >> >>> >> >> >>> Thanks! >> >> >> >> >> >> >> >> > >> >> > >> >> > -- >> >> > "...:::Aniket:::... Quetzalco@tl" >> >> >> > >> > >> > >> > -- >> > "...:::Aniket:::... Quetzalco@tl" >>
+
Michael Lok 2012-01-25, 09:21
|
|