I’m running the following sql in Athena to create a partition
ALTER TABLE database.table ADD
PARTITION (partitionone='123', partitiontwo='456')
LOCATION 's3://<s3-bucket>/data/partitionone=123/partitiontwo=456';
but I’m getting an error Query type not supported by Athena Iceberg at this time
I’ve tried running MSCK REPAIR TABLE
as well but also getting the same error.
How do I create partitions on my Athena Iceberg table?
Iceberg Table DDL
CREATE TABLE database.table (
id int,
name string,
partitionone string,
partitiontwo string)
PARTITIONED BY (`partitionone`, `partitiontwo`)
LOCATION 's3://<s3-bucket>/data'
TBLPROPERTIES (
'table_type'='iceberg'
);
I’ve tried creating the table without the PARTITIONED BY
but still getting the same generic error returned.
2
Answers
For Alter commands in iceberge tables, Parition is not supported yet.
https://docs.aws.amazon.com/athena/latest/ug/querying-iceberg-managing-tables.html
You can try by creating a new one.
https://docs.aws.amazon.com/athena/latest/ug/querying-iceberg-creating-tables.html#querying-iceberg-creating-tables-query-editor
You can use Dremio to update the partitioning and the changes should then take hold in Athena.
You can spin up a Dremio account for free and connect it your AWS Glue or S3 to run ALTER statements against those tables when needed and using Athena or Dremio for querying.
here is the docs on ALTER TABLE: https://docs.dremio.com/cloud/reference/sql/commands/alter-table/