I’m in the portion of the assignment where the ratings table in the curated db is being updated with the new ratings from the json file. There is a part of the code where it checks if the table exists and if it doesn’t, it creates the table. I figure that is where it should apply the format that was provided in the glue parameters, but I can’t see where that happens. The only mention of iceberg is in location, but that doesn’t seem enough to setup the table as iceberg format.
try:
if table_exists:
else:
additional_options = {“write.parquet.compression-codec”: “gzip”}
data_df.writeTo(
f"glue_catalog.{database_name}.{table_name}"
).tableProperty(“format-version”, “2”).tableProperty(
“location”,
f"s3://{data_lake_bucket}/{database_name}/{table_name}/iceberg",
).options(
**additional_options
).create()
logger.info(f"Created {database_name}.{table_name} \n")
except Exception as err:
traceback_error = traceback.format_exc()
logger.error(
f"Error while merging into {database_name}.{table_name}. {traceback_error} {err} \n"