0

I used this as a reference to create a Create statement that creates an Apache Iceberg table in Amazon Athena's Query Editor. Below.

CREATE TABLE iceberg_table (id int, data string, category string)
PARTITIONED BY (category, bucket(16, id))
LOCATION 's3://xxxxxxxx/iceberg_table/'
TBLPROPERTIES (
        'table_type' = 'ICEBERG',
        'format' = 'parquet',
        'write_target_data_file_size_bytes' = '536870912'
)

When I ran this, I got the following error.

Iceberg cannot found the requested entity

Also, when I ran Explain, I got the following message

line 2:1: mismatched input 'PARTITIONED'. Expecting: 'COMMENT', 'WITH', <EOF>

So, I think there is a problem with the Create statement I created. I checked to see if extra spaces had been removed or if the quotes were incorrect, but could not find the cause. I would appreciate your help.

Thanks.

Kensuke Sato
  • 183
  • 1
  • 13

2 Answers2

0

The code works fine for me. I'm using Athena with Engine v3, maybe that's the cause?

Mauro Mascia
  • 401
  • 5
  • 15
0

you can do it in this way:

CREATE TABLE iceberg_table (id int, data string, category string)
with (
        table_type = 'ICEBERG',
        partitioning = ARRAY(category, bucket(16, id))
        LOCATION = 's3://xxxxxxxx/iceberg_table/'
        format = 'parquet',
        write_target_data_file_size_bytes = '536870912'
)