v.22.8Improvement
timeSlots Enhanced with DateTime64 Support for Subsecond Durations
timeSlots now works with DateTime64; subsecond duration and slot size available when working with DateTime64. #37951 (Andrey Zvonov).Why it matters
This feature extends the existingtimeSlots function to work with DateTime64, allowing users to create time slots at subsecond intervals. It solves the problem of creating precise time slots for high-resolution timestamps, enabling more granular time series analysis and aggregation.How to use it
Use thetimeSlots function with columns of type DateTime64 to specify subsecond duration and slot size. For example, you can write:SELECT timeSlots(datetime64_column, INTERVAL 100 MILLISECOND, INTERVAL 1 SECOND) FROM tablewhere the second argument defines the slot duration and the third argument the total slot size.