# =====================================================
# đź§Š Step 4. Write Data to Iceberg Table (Glue Catalog)
# =====================================================
table_name = "glue_catalog.cmt_test_db.iceberg_table"
(
df.writeTo(table_name)
.using("iceberg")
.tableProperty("format-version", "2")
.partitionedBy(
col("city__pk1"),
expr("bucket(3, `age__pk3`)"),
expr("bucket(3, `id__pk2`)")
)
.createOrReplace()
)
print(f"âś… Iceberg table '{table_name}' created/loaded successfully!")
I am getting error **AnalysisException: Invalid partition transformation: bucket(3, age__pk3)
**
I am able to achieve it using AWS Athena SQL Editor. But I want to do it using Dataframe API!!
Please guide me. Thanks in advance!!