databricks Databricks Release Notes ·

Databricks SQL Function time_bucket Aligns Timestamps to Fixed Intervals

datadatabricksgaengineer
feature

Databricks introduces the `time_bucket` SQL function, designed to align timestamps to user-defined, fixed-width intervals like 15-minute or 3-month buckets. This function provides a flexible alternative to `date_trunc` when the desired bucket width or start point doesn't correspond to a standard calendar unit. It is useful for data engineers and analysts working with time-series data, returning the start of the interval a timestamp falls into, aligned to a chosen origin.

Features (1)
  • New time_bucket SQL function for flexible timestamp alignment

    The new `time_bucket` SQL function allows users to align timestamps to fixed-width intervals, such as 15-minute or 3-month buckets, with a customizable origin. This function offers an alternative to `date_trunc` for scenarios where bucket widths or start points do not align with standard calendar units.

Read the original announcement →

https://docs.databricks.com/aws/en/release-notes/product/2026/september#time_bucket-sql-function-aligns-timestamps-to-fixed-width-time-buckets

Related releases