Amazon Athena

To query Tableflow tables using Athena, we can either use table created by Tableflow as explained in above page, or we can us CREATE TABLE statement in Athena.

We can use "CREATE TABLE" directly in Athena, this will create a new Iceberg table and register itself with AWS Glue Data Catalog.

CREATE TABLE [db_name.]table_name
(col_name data_type [COMMENT col_comment] [, ...] ) // schema of table here
LOCATION 's3://demo-bucket/_tableflow/path/to/table'
TBLPROPERTIES (
  'table_type' = 'ICEBERG',
  'format' = 'parquet'
);

Athena create table always creates an empty table. Before querying the table, we need to update the table property of "metadata_location" to point to latest metadata version file. Go to AWS Glue Data Catalog -> Tables -> Select your Tableflow table -> Actions -> Edit Table -> update "metadata_location" in Table properties

Last updated

Was this helpful?