When the Amazon S3 destination is available, it writes each pipeline's data into folders named pipeline=<id> and month=<YYYY-MM>. That is the Hive-style key=value layout Amazon Athena reads as partitions, so you can point one external table at your prefix, declare pipeline and month as partition keys, and load the folders with MSCK REPAIR TABLE instead of adding each partition by hand.
The layout etlmcp writes
Under the bucket and the optional prefix you set on the destination, each pipeline gets its own folder, and each day of data is one object:
<prefix>/pipeline=pl_<id>/month=2026-11/2026-11-29.parquet
<prefix>/pipeline=pl_<id>/month=2026-11/2026-11-30.parquet
<prefix>/pipeline=pl_<id>/month=undated/data.parquet
- The format is CSV or Parquet, chosen on the destination; CSV is the default.
- Rows that carry no date go to the
month=undatedfolder. - A pipeline ID is
pl_followed by lowercase hexadecimal characters, and the folder namespipelineandmonthare lowercase too. - A run rewrites only the days in its date range. The first delivery, and the first after you change the location, format, rules, source or columns, rewrites every stored day and removes that day's objects in the other format.
- etlmcp writes, lists and deletes nothing outside the pipeline's own folder, apart from the test file the Test button writes and removes at the top of the prefix.
What Athena needs from the paths
The AWS partitioning guide says Athena reads Hive-style paths, where each folder holds a partition key and its value joined by an equals sign, and that MSCK REPAIR TABLE loads new partitions only for that style. Other layouts need ALTER TABLE ADD PARTITION for each folder. etlmcp's pipeline= and month= folders already fit, so no manual partition list is needed.
Keep the path lowercase. AWS notes that when an S3 path is in camel case, MSCK REPAIR TABLE does not add the partitions to the AWS Glue Data Catalog. etlmcp's own folder names are lowercase, but the prefix you choose may contain capital letters, so pick a lowercase prefix such as marketing/etlmcp.
MSCK REPAIR TABLE also scans every subfolder under the table's location. Give the etlmcp prefix its own folder tree, and do not put another table's data underneath it, or its folders can be added as partitions of this table.
A table over Parquet files
In etlmcp's Parquet files, date is a date, the metric columns are 64-bit floats, and everything else is text:
CREATE EXTERNAL TABLE etlmcp_ads (
`date` date,
network string,
account_id string,
account_name string,
campaign_id string,
campaign_name string,
adgroup_id string,
adgroup_name string,
ad_id string,
ad_name string,
impressions double,
clicks double,
cost double,
conversions double,
conversion_value double,
ctr double,
cpc double,
cpm double,
cpa double,
currency string
)
PARTITIONED BY (pipeline string, month string)
STORED AS PARQUET
LOCATION '<your bucket and prefix>';
MSCK REPAIR TABLE etlmcp_ads;
Set LOCATION to the S3 location of your bucket followed by your prefix folder, written with the s3 scheme that Athena requires.
Columns a platform sends beyond these are written as extra.<name>, with a dot in the name; see selecting extra columns before you add them to the table.
Filter on the partition keys so Athena scans only the folders you need. AWS states that when the WHERE clause names a partition, only that partition's data is read:
SELECT campaign_name, SUM(cost) AS cost, SUM(clicks) AS clicks
FROM etlmcp_ads
WHERE pipeline = 'pl_0123456789abcdef0123456789abcdef'
AND month = '2026-11'
GROUP BY campaign_name;
Add AND month <> 'undated' when you only want dated rows.
If you choose CSV
etlmcp's CSV files start with a header row and keep a fixed column order: the standard columns first, then any others in alphabetical order. With the Open CSV SerDe, set the table property skip.header.line.count to 1 so the header is not read as data. AWS also notes that this SerDe leaves empty values in numeric columns unread as numbers; declare the metric columns as string and convert them with CAST in a view, and do the same for date, since the SerDe reads dates only as a count of days.
When to run the repair again
Run MSCK REPAIR TABLE again when a new month starts or a new pipeline writes to the prefix; until then, the new folders stay invisible to queries. Days rewritten inside a month you already loaded need no repair: the objects change, but the partition stays the same. For tables whose layout is known in advance, AWS also describes partition projection, which computes partitions from table properties instead of a catalog.