Last active
August 20, 2022 23:37
-
-
Save Gatsby-Lee/5c0d95fabb1cdbe06082ec9df8d2f2b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- default and supported compression | |
-- ref: https://docs.aws.amazon.com/athena/latest/ug/compression-formats.html | |
-- --------------------- | |
-- Set ORC's compression | |
-- --------------------- | |
CREATE TABLE my_db.orc_snappy ( | |
clsuter_id string | |
) | |
STORED AS ORC | |
LOCATION 's3://aws-athena/my_db/orc_snappy' | |
TBLPROPERTIES ("orc.compress"="SNAPPY"); | |
-- disable compression | |
CREATE TABLE my_db.orc_uncompressed ( | |
clsuter_id string | |
) | |
STORED AS ORC | |
LOCATION 's3://aws-athena/my_db/orc_uncompressed' | |
TBLPROPERTIES ("orc.compress"="NONE"); | |
-- ------------------------- | |
-- Set Parquet's compression | |
-- ------------------------- | |
CREATE TABLE my_db.parquet_snappy ( | |
clsuter_id string | |
) | |
STORED AS PARQUET | |
LOCATION 's3://aws-athena/my_db/parquet_snappy' | |
TBLPROPERTIES ("parquet.compression"="SNAPPY"); | |
-- disable compression | |
CREATE TABLE my_db.parquet_uncompressed ( | |
clsuter_id string | |
) | |
STORED AS PARQUET | |
LOCATION 's3://aws-athena/my_db/parquet_uncompressed' | |
TBLPROPERTIES ("parquet.compression"="UNCOMPRESSED"); | |
-- ------------------------- | |
-- Set TEXTFILE's compression | |
-- ------------------------- | |
CREATE TABLE my_db.textfile_gzip ( | |
clsuter_id string | |
) | |
STORED AS TEXTFILE | |
LOCATION 's3://aws-athena/my_db/textfile_gzip' | |
TBLPROPERTIES ("parquet.compression"="GZIP"); | |
-- disable compression | |
CREATE TABLE my_db.textfile_uncompressed ( | |
clsuter_id string | |
) | |
STORED AS TEXTFILE | |
LOCATION 's3://aws-athena/my_db/textfile_uncompressed' | |
TBLPROPERTIES ("write.compression"="NONE"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment