Naveen
Naveen

Reputation: 9

Issue with Complex data types processing in pig with comma delimited data

I have the data like this:

$ cat samp.txt 
Ramesh,[city#Bangalore],123
Arun,[city#Anantapur],345
Pranith,[city#US],456

I have written the following pig query:

A = load 'samp.txt' using PigStorage(',')
as(name:chararray,addr:map[chararray,chararray],empno:int);       

When I execute the above code in pig I am getting the following error:

error: mismatched input ',' expecting RIGHT_BRACKET Details at logfile: /home/training/pig_1471586597209.log

Can any one help me to resolve this error?

Upvotes: 0

Views: 35

Answers (1)

Ankur Alankar Biswal
Ankur Alankar Biswal

Reputation: 1182

A= load 'pdemo/samp' using PigStorage(',') as (name:chararray,add:map[],empno:int);

Now it will work..

Upvotes: 1

Related Questions