0
votes

I have a file test.txt with the following bags:

{(es,1),(de,1),(ps,1),(ro,1),(so,1)}
{(es,1),(de,1),(it,2),(no,1),(ps,1),(ro,1),(so,1)}
{(es,1),(de,1),(so,1)}

I want to load them in Pig

A = LOAD 'test.txt' as (language_bag: bag{t: (a:chararray,f:int)});

And I obtain the following error.

[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: mismatched input ';' expecting RIGHT_PAREN

Details at logfile: /homes/ruthgavi/Projects/Conferences/PigScripts/pig_1426528460732.log

Can somebody help me figure out what I am doing wrong :(

1
Are you sure you are using exactly this code? It works fine for me with your provided input data.LiMuBei
You are right. I was not using exactly this code. For a reason, it works now.ruthy_gg

1 Answers

0
votes

may be it is helpful.

 A = LOAD 'test.txt' as (language_bag: bag {t: tuple(a:chararray,f:int)});

 C = foreach A generate language_bag.a, language_bag.f;

 dump C;