v.25.4New Feature
Introduce toInterval function
IntroducetoIntervalfunction. This function accepts 2 arguments (value and unit), and converts the value to a specificIntervaltype. #78723 (Andrew Davis).
Why it matters
This feature simplifies the creation of interval types by allowing users to specify a value and its corresponding time unit, which ClickHouse then converts to the appropriateInterval. It helps improve query clarity and reduces the need for manual interval construction.How to use it
Call thetoInterval function with two arguments: the numeric value and the unit as a string. For example:SELECT toInterval(5, 'day')This will convert the value
5 to an interval of 5 days.