Strange behaviour in Athena Iceberg Insert: Please ensure target has non-null StorageDescriptor

0

While do insert to Athena Iceberg table from Lambda and Glue job using 'start_query_execution', i am getting error as 'Please ensure target has non-null StorageDescriptor'. the error i got in Athena, that i checked in recent queries. The strange thing is, this SQL through lambda and glue job is working fine in all lower environments and Prod alone we are facing (in Prod also it is working some days and it is not working some days)

I am using Athena Query Engine -2 Insert statement: insert into mydb.my_status_(test_date,string_val,status,system_val,dummy_val) values(timestamp '2023-07-11 00:45:52','my_val','my error msg,'mysystem','')

athena_client.start_query_execution( QueryString=insert_statement, QueryExecutionContext={'Database': database}, ResultConfiguration={'OutputLocation': out_location} )

asked 10 months ago324 views
1 Answer
0

Hello,

Usually this error Please ensure target has non-null StorageDescriptor occurs when a iceberg table is created or updated outside of Athena like using Glue job or EMR Spark etc. Sometimes, it misses to configure the table definition(StorageDescriptor of table) like columns, column type, column parameters, location, compression and other relevant setting based on your requirements. In short, the updated or created iceberg table was corrupted which results in error while performing insert or select. Below are some best practices.


  1. Check the table definition: Verify table definition and ensure all the necessary properties are set correctly, including storage descriptor.
  2. Set the storage descriptor : Make sure your table storage descriptor is complete. Provide the necessary properties such as file format, location, compression and other requirements.
  3. Validate storage descriptor : Check for any typos, missing values or incompatible configurations.

Additionally, you may try to update the table using Athena console or Glue console to set any incomplete properties and then try again to insert.

Moreover, you can compare other working iceberg table definitions to identify any discrepancy. To check StorageDescriptor of a catalog table, you can navigate to Glue console > Table > Actions > View properties

Similar issues were discussed on GitHub 
[1] [2]

Having said that, the issue looks specific into your environment configuration which requires deep dive into your account logs. So, please create a support case by providing Glue job run id or Athena query execution ID which helps to troubleshoot and assist you better.

AWS
answered 10 months 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.

Guidelines for Answering Questions