From 6be203707d3ec25e68946dad2c5540527636b3a8 Mon Sep 17 00:00:00 2001 From: Serhii Dimchenko Date: Wed, 6 Sep 2023 14:28:33 +0200 Subject: [PATCH] Returned Athena query debug --- dbt/adapters/athena/impl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbt/adapters/athena/impl.py b/dbt/adapters/athena/impl.py index 75585cc2..c301acaf 100755 --- a/dbt/adapters/athena/impl.py +++ b/dbt/adapters/athena/impl.py @@ -949,10 +949,12 @@ def _get_table_input(table: TableTypeDef) -> TableInputTypeDef: @available def run_query_with_partitions_limit_catching(self, sql: str) -> str: + sql = self.connections._add_query_comment(sql) conn = self.connections.get_thread_connection() cursor = conn.handle.cursor() + LOGGER.debug(f"Running Athena query:\n{sql}") try: - cursor.execute(sql, catch_partitions_limit=True) + conn.execute(sql, catch_partitions_limit=True) except OperationalError as e: LOGGER.debug(f"CAUGHT EXCEPTION: {e}") if "TOO_MANY_OPEN_PARTITIONS" in str(e):