Skip to content

Instantly share code, notes, and snippets.

@RichardSilveira
Created July 2, 2020 10:24
Show Gist options
  • Save RichardSilveira/c4581680143e414cdab93094fac43bcd to your computer and use it in GitHub Desktop.
Save RichardSilveira/c4581680143e414cdab93094fac43bcd to your computer and use it in GitHub Desktop.
CREATE EXTERNAL TABLE IF NOT EXISTS default.vpc_flow_logs (
version int,
account string,
interfaceid string,
sourceaddress string,
destinationaddress string,
sourceport int,
destinationport int,
protocol int,
numpackets int,
numbytes bigint,
starttime int,
endtime int,
action string,
logstatus string
) PARTITIONED BY (
dt string
) ROW FORMAT DELIMITED FIELDS TERMINATED BY ' ' LOCATION 's3://<vpc-flow-logs-bucket>/AWSLogs/<account-id>/vpcflowlogs/<region>/' TBLPROPERTIES ("skip.header.line.count"="1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment