\unset ECHO clickhouse_raw_query ---------------------- (1 row) clickhouse_raw_query ---------------------- (1 row) clickhouse_raw_query ---------------------- (1 row) clickhouse_raw_query ---------------------- (1 row) -- ROW_NUMBER pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | rn -----------+------------------------+--------+---- lead_100 | 2026-03-15 14:00:00+00 | 200 | 1 lead_100 | 2026-03-01 10:00:00+00 | 100 | 2 lead_200 | 2026-03-20 11:00:00+00 | 300 | 1 lead_200 | 2026-03-10 09:00:00+00 | 150 | 2 lead_300 | 2026-03-05 08:00:00+00 | 250 | 1 (5 rows) -- ROW_NUMBER pushdown (http) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | rn -----------+------------------------+--------+---- lead_100 | 2026-03-15 14:00:00+00 | 200 | 1 lead_100 | 2026-03-01 10:00:00+00 | 100 | 2 lead_200 | 2026-03-20 11:00:00+00 | 300 | 1 lead_200 | 2026-03-10 09:00:00+00 | 150 | 2 lead_300 | 2026-03-05 08:00:00+00 | 250 | 1 (5 rows) -- MIN/MAX OVER pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | min_amount | max_amount -----------+------------------------+--------+------------+------------ lead_100 | 2026-03-01 10:00:00+00 | 100 | 100 | 200 lead_100 | 2026-03-15 14:00:00+00 | 200 | 100 | 200 lead_200 | 2026-03-10 09:00:00+00 | 150 | 150 | 300 lead_200 | 2026-03-20 11:00:00+00 | 300 | 150 | 300 lead_300 | 2026-03-05 08:00:00+00 | 250 | 250 | 250 (5 rows) -- MIN/MAX OVER pushdown (http) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | min_amount | max_amount -----------+------------------------+--------+------------+------------ lead_100 | 2026-03-01 10:00:00+00 | 100 | 100 | 200 lead_100 | 2026-03-15 14:00:00+00 | 200 | 100 | 200 lead_200 | 2026-03-10 09:00:00+00 | 150 | 150 | 300 lead_200 | 2026-03-20 11:00:00+00 | 300 | 150 | 300 lead_300 | 2026-03-05 08:00:00+00 | 250 | 250 | 250 (5 rows) -- LEAD pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | next_event -----------+------------------------+------------------------ lead_100 | 2026-03-01 10:00:00+00 | 2026-03-15 14:00:00+00 lead_100 | 2026-03-15 14:00:00+00 | 1970-01-01 00:00:00+00 lead_200 | 2026-03-10 09:00:00+00 | 2026-03-20 11:00:00+00 lead_200 | 2026-03-20 11:00:00+00 | 1970-01-01 00:00:00+00 lead_300 | 2026-03-05 08:00:00+00 | 1970-01-01 00:00:00+00 (5 rows) -- LEAD pushdown (http) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | next_event -----------+------------------------+------------------------ lead_100 | 2026-03-01 10:00:00+00 | 2026-03-15 14:00:00+00 lead_100 | 2026-03-15 14:00:00+00 | 1970-01-01 00:00:00+00 lead_200 | 2026-03-10 09:00:00+00 | 2026-03-20 11:00:00+00 lead_200 | 2026-03-20 11:00:00+00 | 1970-01-01 00:00:00+00 lead_300 | 2026-03-05 08:00:00+00 | 1970-01-01 00:00:00+00 (5 rows) -- ntile pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | bucket -----------+------------------------+-------- lead_100 | 2026-03-01 10:00:00+00 | 1 lead_300 | 2026-03-05 08:00:00+00 | 1 lead_200 | 2026-03-10 09:00:00+00 | 1 lead_100 | 2026-03-15 14:00:00+00 | 2 lead_200 | 2026-03-20 11:00:00+00 | 2 (5 rows) -- cume_dist pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) ERROR: pg_clickhouse: DB::Exception: Aggregate function with name 'cume_dist' does not exist. In scope SELECT entity_id, amount, cume_dist() OVER (ORDER BY amount ASC) FROM wf_test.events WHERE event_name = 'lead_created' ORDER BY amount ASC NULLS LAST DETAIL: Remote Query: SELECT entity_id, amount, cume_dist() OVER (ORDER BY amount ASC) FROM wf_test.events WHERE ((event_name = 'lead_created')) ORDER BY amount ASC NULLS LAST -- percent_rank pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | amount | pr -----------+--------+------ lead_100 | 100 | 0 lead_200 | 150 | 0.25 lead_100 | 200 | 0.5 lead_300 | 250 | 0.75 lead_200 | 300 | 1 (5 rows) -- ROW_NUMBER + ORDER BY pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | rn -----------+------------------------+--------+---- lead_100 | 2026-03-15 14:00:00+00 | 200 | 1 lead_100 | 2026-03-01 10:00:00+00 | 100 | 2 lead_200 | 2026-03-20 11:00:00+00 | 300 | 1 lead_200 | 2026-03-10 09:00:00+00 | 150 | 2 lead_300 | 2026-03-05 08:00:00+00 | 250 | 1 (5 rows) -- ROW_NUMBER + ORDER BY pushdown (http) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | rn -----------+------------------------+--------+---- lead_100 | 2026-03-15 14:00:00+00 | 200 | 1 lead_100 | 2026-03-01 10:00:00+00 | 100 | 2 lead_200 | 2026-03-20 11:00:00+00 | 300 | 1 lead_200 | 2026-03-10 09:00:00+00 | 150 | 2 lead_300 | 2026-03-05 08:00:00+00 | 250 | 1 (5 rows) -- MIN/MAX OVER + ORDER BY pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | min_amount | max_amount -----------+------------------------+--------+------------+------------ lead_100 | 2026-03-01 10:00:00+00 | 100 | 100 | 200 lead_100 | 2026-03-15 14:00:00+00 | 200 | 100 | 200 lead_200 | 2026-03-10 09:00:00+00 | 150 | 150 | 300 lead_200 | 2026-03-20 11:00:00+00 | 300 | 150 | 300 lead_300 | 2026-03-05 08:00:00+00 | 250 | 250 | 250 (5 rows) -- Window + ORDER BY + LIMIT pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) entity_id | ts_event | amount | rn -----------+------------------------+--------+---- lead_100 | 2026-03-01 10:00:00+00 | 100 | 2 lead_100 | 2026-03-15 14:00:00+00 | 200 | 1 lead_200 | 2026-03-10 09:00:00+00 | 150 | 2 (3 rows) clickhouse_raw_query ---------------------- (1 row) NOTICE: drop cascades to foreign table wf_bin.events NOTICE: drop cascades to foreign table wf_http.events