Skip to content

cannot create iceberg table

1

Dears,

I am trying to create an ice berg table using Athena query as shown:

CREATE TABLE test_kafka.my_record_iceberg ( index string, userid string, firstname string, lastname string, gender string, email string, phone string, dateofbirth string, jobtitle string ) LOCATION 's3://msk-bucket-cdp/myicetable' TBLPROPERTIES ('table_type' ='ICEBERG');

and i am facing this error: (Iceberg cannot find the requested entity)

Could you please help me to solve this issue

asked 2 years ago1.5K views

2 Answers
0

Hello,

The "Iceberg cannot find the requested entity" error is usually thrown when Athena attempts to get an object in the table's underlying s3 bucket which does not exist. It seems like the error occurred because the Iceberg table's underlying metadata file that are pointing to data does not exist, either got deleted or corrupted in the S3 bucket.

Iceberg uses these metadata files stored in s3 to track the table schema, partitioning config, custom properties, and snapshots of the table contents. If any of these metadata files get deleted or corrupted on s3, the Iceberg table will throw an error similar to the above, stating that Athena is unable to read the table metadata.

Please check the metadata files and create the table with new table name.

I created the table with your DDL specifying my S3 location 's3://<my-bucket>/iceberg/test/' and the table got created successfully. In my test, my S3 bucket did not have any folders under test/. After the table creation, it created metadata/ folder with metadata.json file in it.

Please note that we cannot delete iceberg tables from Athena if the s3 path that table corresponds to is deleted from s3. As a workaround to delete the table, please do the following:

  • Navigate into AWS Glue Console --> Tables --> Select the table name --> Actions -> Delete table Iceberg Table will be deleted successfully.

However, if the issue persists, I would suggest you create a case with support to help you with this. Thank you!

AWS

answered 2 years ago

-1

The error you're encountering suggests that there might be an issue with the table creation process for your Iceberg table in Athena. Here are a few things to check and try:

  1. Ensure that you have the necessary permissions to create tables in the specified location. This includes both Athena permissions and S3 bucket permissions.

  2. Verify that the S3 bucket location 's3://msk-bucket-cdp/myicetable' exists and is accessible to your IAM user or role.

  3. Make sure you're using the correct catalog. Iceberg tables in Athena require a specific catalog setup. You might need to specify the catalog explicitly in your query.

  4. Check if you need to include any additional table properties specific to your use case. For Iceberg tables, you've correctly included 'table_type' = 'ICEBERG', but there might be other properties needed depending on your specific requirements.

  5. Ensure that your Athena engine version supports Iceberg tables. If you're using an older version, you may need to upgrade.

  6. Try simplifying the table structure initially. Create a table with fewer columns to see if the issue persists.

If the problem continues after checking these points, you may want to review your Athena and S3 configurations, ensuring all necessary permissions are in place. If you're still facing issues, consider reaching out to AWS support for more detailed troubleshooting specific to your account and setup.
Sources
Troubleshoot Athena Apache Iceberg table errors | AWS re:Post
Create iceberg tables based on encrypted datasets in Amazon S3 | AWS re:Post

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.