JSON表示法:
employee_Kelvin = {
"name": "John Doe",
"salary": 100000.0,
"subordinates": ["Mary Smith", "Todd Jones"],
"deductions": {
"Federal Taxes": .2,
"State Taxes": .05,
"Insurance": .1
},
"address": {
"street": "1 Michigan Ave.",
"city": "Chicago",
"state": "IL",
"zip": 60600
}
}
CREATE TABLE if not exists employees (
name STRING comment 'your name',
salary FLOAT comment 'your job salary',
subordinates ARRAY<STRING> comment 'some people who order to you',
deductions MAP<STRING, FLOAT> comment 'the related tax from your salary',
address STRUCT<street:STRING, city:STRING, state:STRING, zip:INT> comment 'your home address'
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
参考:http://blog.csdn.net/yfkiss/article/details/7842014