CREATE TABLE IF NOT EXISTS jsontest(
date STRING,
channel STRING,
machine STRING,
resolution STRING,
display STRING,
ip STRING,
lat STRING,
lng STRING,
device_key STRING,
os_name STRING,
os_version STRING,
app_name STRING,
app_version STRING,
carradio_version STRING,
carradio_mac STRING,
property STRING,
crate_date STRING,
page STRING,
user_key STRING,
event STRING
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
"date"="$.date",
"channel"="$.data.channel",
"machine"="$.data.machine",
"resolution"="$.data.resolution",
"display"="$.data.display",
"ip"="$.data.ip",
"lat"="$.data.lat",
"lng"="$.data.lng",
"device_key"="$.data.device_key",
"os_name"="$.data.os_name",
"os_version"="$.data.os_version",
"app_version"="$.data.app_version",
"carradio_version"="$.data.carradio_version",
"carradio_mac"="$.data.carradio_mac",
"property"="$.data.property",
"crate_date"="$.data.date",
"page"="$.data.page",
"user_key"="$.data.user_key",
"event"="$.data.event",
"ignore.malformed.json"="true"
)
STORED AS TEXTFILE;
标签:STRING,映射,hive,version,key,date,data,中牛,carradio
From: https://www.cnblogs.com/30go/p/17216063.html