Skip to content

Instantly share code, notes, and snippets.

@rioner
Created October 11, 2018 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rioner/3fe310facb152cd9ed1ee114e9f47350 to your computer and use it in GitHub Desktop.
Save rioner/3fe310facb152cd9ed1ee114e9f47350 to your computer and use it in GitHub Desktop.
CREATE EXTERNAL TABLE IF NOT EXISTS データベース名.テーブル名 (
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://バケット名/AWSLogs/アカウント番号/vpcflowlogs/ap-northeast-1'
TBLPROPERTIES ("skip.header.line.count"="1");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment