spark处理json数据
一、导入数据
源数据格式是这样的
1593136318832|
{
"cm":{
"ln":"-57.4",
"sv":"V2.7.1",
"os":"8.2.9",
"g":"N92TN1PB@gmail.com",
"mid":"1",
"nw":"WIFI",
"l":"pt",
"vc":"12",
"hw":"1080*1920",
"ar":"MX",
"uid":"1",
"t":"1593104002139",
"la":"-45.9",
"md":"sumsung-4",
"vn":"1.0.9",
"ba":"Sumsung",
"sr":"J"
},
"ap":"app",
"et":[
{
"ett":"1593047699935",
"en":"display",
"kv":{
"goodsid":"0",
"action":"2",
"extend1":"2",
"place":"0",
"category":"16"
}
},
{
"ett":"1593105286705",
"en":"newsdetail",
"kv":{
"entry":"3",
"goodsid":"1",
"news_staytime":"36",
"loading_time":"36",
"action":"3",
"showtype":"1",
"category":"53",
"type1":"201"
}
},
{
"ett":"1593044284730",
"en":"ad",
"kv":{
"activityId":"1",
"displayMills":"30370",
"entry":"1",
"action":"2",
"contentType":"0"
}
},
{
"ett":"1593127793318",
"en":"notification",
"kv":{
"ap_time":"1593085393178",
"action":"1",
"type":"4",
"content":""
}
},
{
"ett":"1593051576646",
"en":"active_background",
"kv":{
"active_source":"1"
}
},
{