v.22.8New Feature
Add nowInBlock Function for Current Time Retrieval in ClickHouse
Add functionnowInBlockwhich allows getting the current time during long-running and continuous queries. Closes #39522. Notes: there are no functionsnow64InBlockneithertodayInBlock. #39533 (Alexey Milovidov).
Why it matters
ThenowInBlock function addresses the problem of varying current timestamps during extended query execution, providing a stable and consistent time value throughout the processing of a data block. This ensures reliable time-based computations in long-running queries.How to use it
Use the functionnowInBlock() within your queries exactly as you would use now(). It returns the fixed current time for the duration of processing a data block, making it suitable for long-running or continuous query scenarios.