v.22.7New Feature
Support parseTimeDelta function for time interval parsing
SupportparseTimeDeltafunction. It can be used like;-+,:can be used as separators, eg.1yr-2mo,2m:6s:SELECT parseTimeDelta('1yr-2mo-4w + 12 days, 3 hours : 1 minute ; 33 seconds'). #39071 (jiahui-97).
Why it matters
TheparseTimeDelta function allows users to convert complex, human-readable time interval strings into a ClickHouse interval value, supporting multiple separators like ;-+,:. This simplifies interval parsing and manipulation in queries where flexible time delta input is needed.How to use it
Use theparseTimeDelta function by passing a string representing the time interval with supported units (e.g., yr, mo, w, days, hours, minute, seconds) and separators (;, -, +, ,, :). Example:SELECT parseTimeDelta('1yr-2mo-4w + 12 days, 3 hours : 1 minute ; 33 seconds')