You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Avoid aggregate repartitioning for audited date_trunc on single-key timestamp ranges #26448
Grouped aggregation can avoid a hash shuffle when transforming a range-partitioned timestamp keeps every group within one input partition.
For example, suppose a table is range-partitioned on timestamp, with partitions split at hourly boundaries:
SELECT
key,
date_trunc('hour', timestamp) AS hour,
SUM(value)
FROM events
GROUP BY key, date_trunc('hour', timestamp);
Each (key, hour) group belongs entirely to one partition, so aggregation can finish independently in each partition. Changing the grouping expression to date_trunc('day', timestamp) would combine rows from multiple hourly partitions and still require a shuffle.
Initially support audited, timezone-less date_trunc expressions over single-key timestamp ranges. Require an explicit, default-deny function capability and validate concrete split boundaries before removing repartitioning. Unsafe or unknown cases must retain the shuffle, and the aggregate-locality proof must not establish join-layout compatibility.
Activity
feat: reuse range partitioning for date_trunc aggregation (apache#26449)