[Athena] Error creating Iceberg table

0

I am trying to create iceberg table with CTAS using CLI but getting internal error. Using athena engine version 3 Here is my query CREATE TABLE test_db_2.test_table_2 WITH (table_type = 'ICEBERG', format = 'PARQUET', location = 's3://bucket_namexxx/test_db_2/test_table_2/', is_external = false ) AS SELECT col1, col2, col3 from test_db_1.test_table_1;

FAILED  [ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience. You may need to manually clean the data at location 's3://xxxxxx/tables/3xxxxxxxxxxx' before retrying. Athena will not delete data in your account.

Any idea what is the issue? Where can I see the detailed error?

manny
已提問 9 個月前檢視次數 793 次
2 個答案
0

Did you try adding From keyword in second part of your query as below:

 CREATE TABLE test_db_2.test_table_2 WITH (table_type = 'ICEBERG', format = 'PARQUET', location = 's3://bucket_namexxx/test_db_2/test_table_2/', is_external = false ) AS SELECT col1, col2, col3 from test_db_1.test_table_1;

Also, did you try running the same query in different engine version.

Most probable cause of this type of error use to be, when we mistakenly use Athena reserved keyword listed here, but it doesn't seem to be the case here.

Comment here how it goes, happy to help.

Abhishek

profile pictureAWS
專家
已回答 9 個月前
  • Hi Abhishek, Yes "from" is there in the query.. it was missed while posting question.. Have updated it.. Also with Athena version 2 it is giving unsupported error as suggesting to use version 3.

  • Can you explain, what is the purpose of this query "AS SELECT col1, col2, col3 from test_db_1.test_table_1"?

    Did you try creating the iceberg table, with this syntax:

    CREATE TABLE iceberg_table ( id int, data string, category string) PARTITIONED BY (category, bucket(16,id)) LOCATION 's3://DOC-EXAMPLE-BUCKET/iceberg-folder' TBLPROPERTIES ( 'table_type'='ICEBERG', 'format'='parquet', 'write_compression'='snappy', 'optimize_rewrite_delete_file_threshold'='10' )

0

Found a typo in the bucket name.. I wish the internal logs are available to us for these kind of error.

manny
已回答 9 個月前
  • I'm glad you found the problem at least :)

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南