Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active January 6, 2020 01:40
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 garystafford/5083032b8e187b434f292885d72f2d61 to your computer and use it in GitHub Desktop.
Save garystafford/5083032b8e187b434f292885d72f2d61 to your computer and use it in GitHub Desktop.
query = \
"CREATE TABLE IF NOT EXISTS " + data_catalog + "." + output_directory + " " \
"WITH ( " \
" format = 'PARQUET', " \
" parquet_compression = 'SNAPPY', " \
" partitioned_by = ARRAY['dt'], " \
" external_location = 's3://" + data_bucket + "/" + output_directory + "' " \
") AS " \
"SELECT * " \
"FROM " + data_catalog + "." + input_directory + ";"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment