-- Show top 10 event categories
SELECT eventcode,
gdelt.eventcodes.description,
nb_events
FROM (SELECT gdelt.events.eventcode,
COUNT(gdelt.events.globaleventid) AS nb_events
FROM gdelt.events
GROUP BY gdelt.events.eventcode
ORDER BY nb_events DESC LIMIT 10)
JOIN gdelt.eventcodes ON eventcode = gdelt.eventcodes.code
ORDER BY nb_events DESC;
which uses the following table
CREATE EXTERNAL TABLE IF NOT EXISTS gdelt.eventcodes (code string,description string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' WITH SERDEPROPERTIES ('serialization.format' = '\t','field.delim' = '\t') LOCATION 's3://jsimon-events-data/eventcodes/';
I am unable to run the following query
-- Show top 10 event categories SELECT eventcode, gdelt.eventcodes.description, nb_events FROM (SELECT gdelt.events.eventcode, COUNT(gdelt.events.globaleventid) AS nb_events FROM gdelt.events GROUP BY gdelt.events.eventcode ORDER BY nb_events DESC LIMIT 10) JOIN gdelt.eventcodes ON eventcode = gdelt.eventcodes.code ORDER BY nb_events DESC;
which uses the following table
CREATE EXTERNAL TABLE IF NOT EXISTS gdelt.eventcodes (
code
string,description
string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' WITH SERDEPROPERTIES ('serialization.format' = '\t','field.delim' = '\t') LOCATION 's3://jsimon-events-data/eventcodes/';I get error:
Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 8684B655EB7B087B; S3 Extended Request ID: HmeoCXhjP/HgYW/0fiWA42vK8ImkbwCFOAVK0sZAZ3x9cB+VISKRqB5JME6R4vphi6mLT+WJbQc=)