Skip to content

Commit

Permalink
fix: adjust control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
JossWhittle committed Oct 27, 2023
1 parent b464550 commit 13dc749
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions dags/ingest_csv_to_iceberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,14 @@ def ingest_csv_to_iceberg():
location=hive_path
)

try:
logging.info("Create table in Iceberg connector...")
iceberg_create_table_from_hive(
trino,
table=iceberg_table,
hive_table=hive_table,
columns=columns,
location=iceberg_path
)

except Exception as ex:
logging.error("Cleanup schema in Iceberg connector...")
raise ex
logging.info("Create table in Iceberg connector...")
iceberg_create_table_from_hive(
trino,
table=iceberg_table,
hive_table=hive_table,
columns=columns,
location=iceberg_path
)

finally:
logging.info("Cleanup table in Hive connector...")
Expand Down

0 comments on commit 13dc749

Please sign in to comment.