Athena partition projection generator
Configure enum, integer, date or injected partition columns — get ready CREATE TABLE and ALTER TABLE SQL.
CREATE TABLE
CREATE EXTERNAL TABLE `events` ( `id` string ) PARTITIONED BY (`year` string) LOCATION 's3://my-bucket/events/' TBLPROPERTIES ( 'projection.enabled'='true', 'projection.year.type'='date', 'projection.year.range'='2015-01,NOW', 'projection.year.format'='yyyy-MM', 'projection.year.interval'='1', 'projection.year.interval.unit'='MONTHS' );
ALTER TABLE (existing table)
ALTER TABLE `events` SET TBLPROPERTIES ( 'projection.enabled'='true', 'projection.year.type'='date', 'projection.year.range'='2015-01,NOW', 'projection.year.format'='yyyy-MM', 'projection.year.interval'='1', 'projection.year.interval.unit'='MONTHS' );
Runs in your browser. Nothing you type is sent anywhere.
How this works
- Each partition column needs projection.<column>.type, plus type-specific properties: enum needs .values; integer needs .range (and optional .interval/.digits); date needs .range and .format (plus .interval/.interval.unit); injected needs only .type. docs ↗
- projection.enabled must be set to true for the table, or Athena ignores every per-column property. docs ↗
- storage.location.template is optional — only needed when your S3 layout doesn't follow the usual column=value/ pattern, and must contain a placeholder for every partition column. docs ↗
Do this against your live database in Tablyne.
Amazon Athena Client →FAQ
Do I need storage.location.template? +
Only if your S3 paths don't follow the standard .../column=value/... layout. If they do, skip it — Athena derives the location from the partition values automatically.
Can I mix projection types in one table? +
Yes — a table can combine enum, integer, date and injected columns in any combination.
What happens if I enable projection but miss a column's configuration? +
Athena fails with a metastore error naming the missing column — every partition column needs at least its .type property once projection.enabled is true.