Skip to main content

Learn how to do partitioned writes by year and month on S3

I want to export data segregating the path in S3 bucket to follow a structure like:
  • 2022
    • 1
    • 2
    • 12
  • 2021
    • 1
    • 2
    • 12
and so on …

Answer

Considering the ClickHouse table:
Add 10000 entries:
Run this to create the desired structure in s3 bucket my_bucket (note this example writes files in parquet format):
Last modified on June 29, 2026