· 6 years ago · Jun 19, 2019, 03:26 PM
1{
2 "user_id": "kim95",
3 "type": "Book",
4 "title": "Modern Database Systems: The Object Model, Interoperability, and Beyond.",
5 "year": "1995",
6 "publisher": "ACM Press and Addison-Wesley",
7 "authors": [
8 {
9 "name": "null"
10 }
11 ],
12 "source": "DBLP"
13}
14{
15 "user_id": "marshallo79",
16 "type": "Book",
17 "title": "Inequalities: Theory of Majorization and Its Application.",
18 "year": "1979",
19 "publisher": "Academic Press",
20 "authors": [
21 {
22 "name": "Albert W. Marshall"
23 },
24 {
25 "name": "Ingram Olkin"
26 }
27 ],
28 "source": "DBLP"
29}
30
31CREATE EXTERNAL TABLE IF NOT EXISTS serd (
32 user_id:string,
33 type:string,
34 title:string,
35 year:string,
36 publisher:string,
37 authors:array<struct<name:string>>,
38 source:string)
39 ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
40 LOCATION '/user/hdfs/data/book-seded_workings-reduced.json';
41
42error while compiling statement: failed: parseexception line 2:17 cannot recognize input near ':' 'string' ',' in column type
43
44Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Cannot validate serde: org.openx.data.jsonserde.JsonSerde
45
46CREATE EXTERNAL TABLE IF NOT EXISTS serd (
47user_id string,type string,title string,year string,publisher string,authors array<string>,source:string)
48ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
49LOCATION...
50
51{"user_id": "kim95", "type": "Book", "title": "Modern Database Systems: The Object Model, Interoperability, and Beyond.", "year": "1995", "publisher": "ACM Press and Addison-Wesley", "authors": [{"name":"null"}], "source": "DBLP"}
52{"user_id": "marshallo79", "type": "Book", "title": "Inequalities: Theory of Majorization and Its Application.", "year": "1979", "publisher": "Academic Press","authors": [{"name":"Albert W. Marshall"},{"name":"Ingram Olkin"}], "source": "DBLP"}