Ravi
Ravi

Reputation: 21

Apache Pig LOAD error

I am trying to load data using pig script. My input is as follows

(1, {(1,2), (1,3), (1,4)} )
(2, {(2,5), (2,6), (2,7)} )

Script

X = LOAD 'input1.txt' as (a:tuple(a1: int, b1: bag{}));
dump X;

ERROR:

mismatched input ';' expecting RIGHT_PAREN

Please let me know correct schema to load data.

Upvotes: 2

Views: 275

Answers (1)

Aman
Aman

Reputation: 3261

It is working for me ..

((1,{(1,2),(1,3),(1,4)}))
((2,{(2,5),(2,6),(2,7)}))


grunt> X = LOAD '/Q3.txt' as (a:tuple(a1: int, b1: bag{}));  

Input(s):
Successfully read 2 records (411 bytes) from: "/Q3.txt"

Output(s):
Successfully stored 2 records (59 bytes) in: "hdfs://localhost:9000/tmp/temp-2096988480/tmp-1540654064"

C

Here is the output :

2015-09-19 23:16:37,440 [main] INFO  org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Success!
2015-09-19 23:16:37,443 [main] INFO  org.apache.pig.data.SchemaTupleBackend - Key [pig.schematuple] was not set... will not generate code.
2015-09-19 23:16:37,448 [main] INFO  org.apache.hadoop.mapreduce.lib.input.FileInputFormat - Total input paths to process : 1
2015-09-19 23:16:37,448 [main] INFO  org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input paths to process : 1
((1,{(1,2),(1,3),(1,4)}))
((2,{(2,5),(2,6),(2,7)}))

Upvotes: 1

Related Questions