@@ -261,6 +261,7 @@ def _resolve_query_without_cache_ctas(
261
261
alt_database : Optional [str ],
262
262
name : Optional [str ],
263
263
ctas_bucketing_info : Optional [Tuple [List [str ], int ]],
264
+ ctas_write_compression : Optional [str ],
264
265
use_threads : Union [bool , int ],
265
266
s3_additional_kwargs : Optional [Dict [str , Any ]],
266
267
boto3_session : boto3 .Session ,
@@ -276,6 +277,7 @@ def _resolve_query_without_cache_ctas(
276
277
s3_output = s3_output ,
277
278
workgroup = workgroup ,
278
279
encryption = encryption ,
280
+ write_compression = ctas_write_compression ,
279
281
kms_key = kms_key ,
280
282
wait = True ,
281
283
boto3_session = boto3_session ,
@@ -409,6 +411,7 @@ def _resolve_query_without_cache(
409
411
ctas_database_name : Optional [str ],
410
412
ctas_temp_table_name : Optional [str ],
411
413
ctas_bucketing_info : Optional [Tuple [List [str ], int ]],
414
+ ctas_write_compression : Optional [str ],
412
415
use_threads : Union [bool , int ],
413
416
s3_additional_kwargs : Optional [Dict [str , Any ]],
414
417
boto3_session : boto3 .Session ,
@@ -439,6 +442,7 @@ def _resolve_query_without_cache(
439
442
alt_database = ctas_database_name ,
440
443
name = name ,
441
444
ctas_bucketing_info = ctas_bucketing_info ,
445
+ ctas_write_compression = ctas_write_compression ,
442
446
use_threads = use_threads ,
443
447
s3_additional_kwargs = s3_additional_kwargs ,
444
448
boto3_session = boto3_session ,
@@ -656,7 +660,7 @@ def get_query_results(
656
660
657
661
658
662
@apply_configs
659
- def read_sql_query (
663
+ def read_sql_query ( # pylint: disable=too-many-arguments,too-many-locals
660
664
sql : str ,
661
665
database : str ,
662
666
ctas_approach : bool = True ,
@@ -672,6 +676,7 @@ def read_sql_query(
672
676
ctas_database_name : Optional [str ] = None ,
673
677
ctas_temp_table_name : Optional [str ] = None ,
674
678
ctas_bucketing_info : Optional [Tuple [List [str ], int ]] = None ,
679
+ ctas_write_compression : Optional [str ] = None ,
675
680
use_threads : Union [bool , int ] = True ,
676
681
boto3_session : Optional [boto3 .Session ] = None ,
677
682
max_cache_seconds : int = 0 ,
@@ -838,6 +843,9 @@ def read_sql_query(
838
843
Tuple consisting of the column names used for bucketing as the first element and the number of buckets as the
839
844
second element.
840
845
Only `str`, `int` and `bool` are supported as column data types for bucketing.
846
+ ctas_write_compression: str, optional
847
+ Write compression for the temporary table where the CTAS result is stored.
848
+ Corresponds to the `write_compression` parameters for CREATE TABLE AS statement in Athena.
841
849
use_threads : bool, int
842
850
True to enable concurrent requests, False to disable multiple threads.
843
851
If enabled os.cpu_count() will be used as the max number of threads.
@@ -963,6 +971,7 @@ def read_sql_query(
963
971
ctas_database_name = ctas_database_name ,
964
972
ctas_temp_table_name = ctas_temp_table_name ,
965
973
ctas_bucketing_info = ctas_bucketing_info ,
974
+ ctas_write_compression = ctas_write_compression ,
966
975
use_threads = use_threads ,
967
976
s3_additional_kwargs = s3_additional_kwargs ,
968
977
boto3_session = session ,
@@ -987,6 +996,7 @@ def read_sql_table(
987
996
ctas_database_name : Optional [str ] = None ,
988
997
ctas_temp_table_name : Optional [str ] = None ,
989
998
ctas_bucketing_info : Optional [Tuple [List [str ], int ]] = None ,
999
+ ctas_write_compression : Optional [str ] = None ,
990
1000
use_threads : Union [bool , int ] = True ,
991
1001
boto3_session : Optional [boto3 .Session ] = None ,
992
1002
max_cache_seconds : int = 0 ,
@@ -1131,6 +1141,9 @@ def read_sql_table(
1131
1141
Tuple consisting of the column names used for bucketing as the first element and the number of buckets as the
1132
1142
second element.
1133
1143
Only `str`, `int` and `bool` are supported as column data types for bucketing.
1144
+ ctas_write_compression: str, optional
1145
+ Write compression for the temporary table where the CTAS result is stored.
1146
+ Corresponds to the `write_compression` parameters for CREATE TABLE AS statement in Athena.
1134
1147
use_threads : bool, int
1135
1148
True to enable concurrent requests, False to disable multiple threads.
1136
1149
If enabled os.cpu_count() will be used as the max number of threads.
@@ -1202,6 +1215,7 @@ def read_sql_table(
1202
1215
ctas_database_name = ctas_database_name ,
1203
1216
ctas_temp_table_name = ctas_temp_table_name ,
1204
1217
ctas_bucketing_info = ctas_bucketing_info ,
1218
+ ctas_write_compression = ctas_write_compression ,
1205
1219
use_threads = use_threads ,
1206
1220
boto3_session = boto3_session ,
1207
1221
max_cache_seconds = max_cache_seconds ,
0 commit comments