This is Part 5 of a 15-part covered partition evolution. This article covers hidden partitioning, the feature that ensures users never need to know how their data is physically organized.
The most expensive mistake in data lake querying is the accidental full table scan: a query that reads every file because the user did not correctly reference the partition columns. In Hive, this happens constantly. In Iceberg, it is structurally impossible because users never reference partition columns at all.
Table of Contents
In Hive, a table partitioned by
year,month, anddayrequires queries to filter on those exact columns:
CODE-- Hive: This prunes correctly
SELECT * FROM orders WHERE year = 2024 AND month = 3 AND day = 15
-- Hive: This scans EVERYTHING (no pruning)
SELECT * FROM orders WHERE order_date = '2024-03-15'
The second query reads every partition because Hive does not know that
order_datemaps to theyear,month, anddaypartition columns. There is no error, no warning. The query simply runs 100x slower than it should.
This happens because Hive partitioning is "exposed." The physical partition columns (
year,month,day) are separate from the source column (order_date). Users must understand this mapping and construct their filters accordingly.
How Iceberg Hides Partitioning
Iceberg flips this model. Users filter on the source column (
order_date), and the engine automatically maps the filter to the partition values using
Iceberg defines six
The temporal transforms are hierarchical. If a table is partitioned by
day(ts)and a user filtersWHERE ts >= '2024-03-01' AND ts < '2024-04-01', the engine recognizes this as a range of days and prunes to only the 31 matching partitions. Engines like
truncate(N, col)takes the first N characters of a string (or truncates a number to a width). This is useful when you want to group data by a string prefix without creating one partition per unique value.
bucket(N, col)applies a hash function and mod N to produce a bucket number from 0 to N-1. This distributes data evenly across a fixed number of buckets, regardless of the column's value distribution. It is the go-to transform for high-cardinality columns likeuser_idororder_idwhere identity partitioning would create millions of tiny partitions.
The Identity Transform
The identity transform (
identity(col)) uses the raw column value as the partition value. This is equivalent to Hive-style partitioning, but the column is still "hidden" because the engine handles the mapping. It is useful for low-cardinality columns likeregionorstatuswhere each unique value should be its own partition.
How Pruning Works Under the Hood
, but now the partition values were derived automatically from the user's filter on a source column.
Choosing the Right Transform
The choice of partition transform depends on data volume and query patterns:
supports all Iceberg transform functions and automatically applies pruning for any combination of partition columns in the query's WHERE clause.
Why This Matters for Teams
Hidden partitioning changes the operational model for data teams:
Data engineers define the partition strategy once in the table's partition spec. They can change it later through .
The net result: no accidental full table scans, no partition-aware query patterns required from users, and the ability to change the physical layout without impacting any downstream consumer. by Alex Merced (Manning)
by Alex Merced
by Alex Merced
SOCIAL SHARE CARD GENERATOR