Share Your AWS re:Post Experience - Quick 3 Question Survey
Help us improve AWS re:Post! We're interested in understanding how you use re:Post and its impact on your AWS journey. Please take a moment to complete our brief 3-question survey.
How can I troubleshoot Apache Iceberg table errors with Athena?
I used an Apache Iceberg table with Amazon Athena and received an error message.
Resolution
Follow the troubleshooting steps for the error message that you received.
Unsupported table property key
This error occurs when the TBLPROPERTIES clause of the CREATE TABLE or ALTER TABLE statement doesn't use a supported table property. Athena allows only a predefined list of key-value pairs in the table properties to create or modify Iceberg tables.
To resolve this issue, make sure that your Iceberg table uses supported table properties.
CREATE TABLE statement cannot be generated because table has unsupported properties
This error occurs with queries that use the SHOW CREATE TABLE DDL statement with Iceberg tables when Athena can't reproduce the table structure. Use the DESCRIBE FORMATTED DDL statement to show the table properties instead of SHOW CREATE TABLE.
TABLE_REDIRECTION_ERROR
This error occurs with Athena SELECT queries that use unsupported Iceberg table metadata. Make sure that your Athena SELECT query contains supported Iceberg table metadata.
NOT_SUPPORTED: Type not supported for Iceberg
This error occurs when you use an unsupported data type with an Iceberg table. For example, the tinyint, smallint, and char Athena data types aren't supported for Iceberg tables. Make sure that your Athena query uses a supported data type for Iceberg tables.
ICEBERG_COMMIT_ERROR
This error might occur when multiple statements try to modify the same set of files that run in parallel Iceberg table updates. For example, this error occurs when multiple DELETE statements run in parallel and try to delete the same set of records at the same time.
To avoid this issue, take the following actions:
- Make sure that query updates run sequentially to avoid parallel data processing.
- Implement a retry mechanism with exponential backoff when you update Iceberg tables.
Note: Athena supports only AWS Glue optimistic locking. When you modify an Iceberg table with other lock methods, you might cause data loss and break transactions.
For more information, see Optimistic locking on the Apache Iceberg website.
GENERIC_INTERNAL_ERROR: Cannot write delete files in a v1 table
This error occurs when you try the DELETE operation on an Iceberg v1 table. Athena creates and operates only on Iceberg v2 tables.
Make sure that your Iceberg table uses the Athena engine version 2. If you use another type of engine, then make sure that the format-version table property is set to 2 to allow row-level deletes. For example, use version 2 when you write an Iceberg table and register it to the AWS Glue Data Catalog.
For more information, see Delete formats on the Apache Iceberg website.
GENERIC_INTERNAL_ERROR: com.facebook.presto.spi.PrestoException: The specified key does not exist
This error occurs when you delete a metadata file, such as a manifest list or metadata.json. The Athena query then fails. If you can't successfully recover the file, then roll back the table to a snapshot or timestamp.
Note: You must roll back the table in a Spark environment, such as AWS Glue or Amazon EMR, not the Athena query editor.
To roll back the table to a specific snapshot ID, run the roll_to_snapshot Apache Iceberg command:
CALL catalog_name.system.rollback_to_snapshot('your-db.your-table', your-snapshot-id)
Note: Replace your-db, your-table, and your-snapshot-id with your variables.
To roll back the table to a specific timestamp, run the rollback_to_timestamp Apache Iceberg command:
CALL catalog_name.system.rollback_to_timestamp('your-db.your-table', TIMESTAMP 'yyyy-mm-dd hh:mm:ss')
Note: Replace your-db, your-table, and yyyy-mm-dd hh:mm:ss with your variables.
For more information, see rollback_to_snapshot and rollback_to_timestamp on the Apace Iceberg website.
Related information
How can I use Apache Iceberg with a cross-account AWS Glue Data Catalog in Spark?

Contenuto pertinente
- AWS UFFICIALEAggiornata un anno fa
- AWS UFFICIALEAggiornata 2 mesi fa
- AWS UFFICIALEAggiornata un anno fa