我正在尝试查询这个 JSON 文件(出于调试目的,它只包含一行!):
{
"appVersion": null,
"sessionIndex": "3",
"psdkLang": null,
"lamdbaAwsRequestId": "bb04330c-e1e7-4bbd-97b8-86fdb2ee0b7f",
"bundleID": "xyz",
"receiveTimestamp": "2017-03-31T01:45:30.796Z",
"type": "logEvent",
"userIdfv": null,
"osVersion": null,
"uniqueIndex": "9c6c3927-aa66-4974-adac-fd10fc83a1e5",
"userIdfa": null,
"eventName": "Rewarded Ads Ad Is Ready",
"deviceType": null,
"eventId": "shardId-000000000005:49571690399037302251611429510623174446442870333536993362",
"store1": "google",
"deviceLang": null,
"geoCode": null,
"sessionId": "34B4CEC8-9AA0-40DD-94C4-C5420F563F68",
"params": "{\"AdProvider\":\"AdColony\",\"AdIsReady\":\"false\"}",
"gameVersion": null,
"internetConnectionState": null,
"deviceModel": null,
"deviceTimeZone": null,
"time": "2017-03-31T10:44:50.117+0900",
"userId": "24176983"
}
我在 Amazon Athena 中创建了一个表:
CREATE EXTERNAL TABLE IF NOT EXISTS RV_QA.RAAIR (
`appversion` string,
`psdklang` string,
`bundleid` string,
`receivetimestamp` string,
`type` string,
`osversion` string,
`store1` string,
`devicelang` string,
`geocode` string,
`sessionid` string,
`eventName` string,
`params` map<string,string>
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1'
) LOCATION 's3://...'
TBLPROPERTIES ('has_encrypted_data'='false');
当我运行此查询时:
select eventname from RAAIR;
一切正常。
当我尝试使用嵌套 JSON(params 元素)时:
select params['AdIsReady'] from RAAIR;
我收到“内部错误”消息。
我在这里想念什么?