You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Berté Moussa <mo...@gmail.com> on 2014/07/16 23:12:23 UTC

result of jsonloader of pig script with bag is empty

Hi,

I'm using cdh5 quickstart vm and I have a file like this(not full here):


{"user_id": "kim95",
 "type": "Book",
 "title": "Modern Database Systems: The Object Model, Interoperability, and
Beyond.",
 "year": "1995",
 "publisher": "ACM Press and Addison-Wesley",
 "authors": {},
 "source": "DBLP"
}
{"user_id": "marshallo79",
 "type": "Book",
 "title": "Inequalities: Theory of Majorization and Its Application.",
 "year": "1979",
 "publisher": "Academic Press",
 "authors": {("Albert W. Marshall"), ("Ingram Olkin")},
 "source": "DBLP"
}

....



and i used this script:

books = load 'data/book-seded.json'
        using JsonLoader('t1:tuple(user_id:
chararray,type:chararray,title:chararray,year:chararray,publisher:chararray,source:chararray,authors:bag{T:tuple(author:chararray)})');

STORE books INTO 'book-no-seded.tsv';


the script work , but the generated file is empty, do you have any idea ?

Uh..I forgot to say that I used cat to have all the file in one line(i
don't why, but the piece of file shown here didn't work in hue)

Thanks