\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) ERROR: pg_clickhouse: DB::Exception: Unknown aggregate function lead DETAIL: Remote Query: SELECT entity_id, ts_event, lead(ts_event) OVER (PARTITION BY entity_id ORDER BY ts_event ASC) FROM wf_test.events WHERE ((event_name = 'lead_created')) -- LEAD pushdown (http) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) ERROR: pg_clickhouse: Code: 63. DB::Exception: Unknown aggregate function lead. (UNKNOWN_AGGREGATE_FUNCTION) DETAIL: Remote Query: SELECT entity_id, ts_event, lead(ts_event) OVER (PARTITION BY entity_id ORDER BY ts_event ASC) FROM wf_test.events WHERE ((event_name = 'lead_created')) CONTEXT: HTTP status code: 404 -- ntile pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) ERROR: pg_clickhouse: DB::Exception: ntile's frame type must be ROWS DETAIL: Remote Query: SELECT entity_id, ts_event, ntile(2) OVER (ORDER BY ts_event ASC) FROM wf_test.events WHERE ((event_name = 'lead_created')) ORDER BY ts_event ASC NULLS LAST -- cume_dist pushdown (binary) QUERY PLAN --------------------------------- Foreign Scan Relations: Window on (events) (2 rows) ERROR: pg_clickhouse: DB::Exception: Unknown aggregate function cume_dist 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) ERROR: pg_clickhouse: DB::Exception: Unknown aggregate function percent_rank DETAIL: Remote Query: SELECT entity_id, amount, percent_rank() OVER (ORDER BY amount ASC) FROM wf_test.events WHERE ((event_name = 'lead_created')) ORDER BY amount ASC NULLS LAST -- 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