v.19.14Improvement

Support ASOF JOIN with ON Section

Support ASOF JOIN with ON section. #6211 (Artem Zuikov)
Added support for using the ASOF JOIN clause with an ON section in ClickHouse.

Why it matters

This feature allows users to specify join conditions explicitly using an ON clause when performing ASOF JOIN. It enhances join flexibility and expressiveness, enabling more complex and precise time-aware joining logic.

How to use it

To use this feature, write an ASOF JOIN with an ON clause specifying the join keys and conditions. For example:

SELECT *
FROM table1
ASOF JOIN table2
ON table1.key = table2.key
AND table1.timestamp <= table2.timestamp

This explicitly defines the join keys and improves readability and control over the join behavior.