Skip to content

Instantly share code, notes, and snippets.

@tssandor
Created February 15, 2022 08:20
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 tssandor/5027328511bf9757ae2055426a211fb9 to your computer and use it in GitHub Desktop.
Save tssandor/5027328511bf9757ae2055426a211fb9 to your computer and use it in GitHub Desktop.
CREATE EXTERNAL TABLE <your-dbname>.<table-name> (
`device_id` string,
`id_type` string,
`latitude` float,
`longitude` float,
`horizontal_accuracy` float,
`timestamp` bigint,
`ip_address` string,
`device_os` string,
`os_version` string,
`user_agent` string,
`country_code` string,
`source_id` string,
`publisherid` string,
`app_id` string,
`location_context` string,
`geohash` string)
PARTITIONED BY (
`year` int,
`month` int,
`day` int)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 's3://<your-s3-bucket-name>/'
TBLPROPERTIES (
'has_encrypted_data'='false',
'parquet.compression'='GZIP')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment