Use Iceberg hidden partitioning with partition transforms to decouple query predicates from physical layout

domain: iceberg.apache.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define the table with a transform-based partition spec such as PARTITIONED BY (hours(event_time), truncate(16, user_id)) so the physical partitioning is hidden from query writers.
  2. Write queries using plain column predicates like WHERE event_time BETWEEN '2024-01-01' AND '2024-01-02' without referencing partition columns directly; Iceberg will prune partitions automatically.
  3. Confirm partition pruning is active by running EXPLAIN on the query and verifying only relevant partition files are scanned.
  4. Use available transforms: identity, bucket(N, col), truncate(L, col), years(col), months(col), days(col), hours(col) based on the query and cardinality patterns of each column.
  5. Review the partition spec via SELECT * FROM my_catalog.db.my_table.partitions to inspect how transforms map to physical partition values.

Known gotchas

Related routes

Evolve an Iceberg partition spec using hidden partitioning without rewriting existing data
iceberg.apache.org · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans