apache pig - Pig : result of json loader empty -
I am using cdh5 quickstart vm and I have such a file (not complete here): < "Database": "Model", "type": "book", "title": "Modern database system: object model, interoperability, "", "Year": "1995", "Publisher": "ACM Press and Addison-Wesley", "Author": {}, "Source": "DBLP"} {"user_id": "Marshallo 79" , "Type": "book", "title": "Inequality: majority and principle of its application.", "Year": "1979," "Publisher": "Academic Press", "Writer": {("Albert W Marshall"), "Source": "DBLP"}
And I used this script:
books = load 'data / book- ceded.jason', authors: Bags {T: Tuple (Author: chararray)}); Books' No-c Grade '.
The script works, but the generated file is empty, do you have any ideas? In the end, only this schema works: If I add or remove a location different from this configuration then I get an error:
<">" User_id ":" kim95 "," type ":" book "," title ":" adm press and edison-wesley "," authors ":" [["name" ":" Source: ":" Marshallo 79 "," Type ":" Modern Database System: Object Model, Interoperability, and Beyond "," Year ":" 1995 "," Publisher ""] "," Source " ":" Book "," Title ":" Inequality: Principle of majority and its application "," Year ":" 1979 "," Publisher ":" Academic Press "," Author ": [{" Name " : "Albert W." Marshall "}, {" name ":" ingram olkin "}]," source ":" dblp "}
and the working script is thi s:
< Pre> book = load 'data / book-seded-workings-reduced.json' using JsonLoader ('user_id: charrray, type: chararray, title: chararray, year: chararray, publisher: chararray, authors: { (Name: chararray)}, source: chararray '); Books in books' book-table.csv'; // What does .tsv or .csv
Comments
Post a Comment