timeplus-io / proton

A stream processing engine and database, and a fast and lightweight alternative to ksqlDB and Apache Flink, 🚀 powered by ClickHouse
https://timeplus.com
Apache License 2.0
1.58k stars 69 forks source link

incorrect explain syntax #820

Closed yl-lisen closed 3 months ago

yl-lisen commented 3 months ago

Describe what's wrong

:) create stream t1(i int, v int);

:) explain syntax select count() over (partition by i) as x, lag(x) from changelog(t1, i);

EXPLAIN SYNTAX
SELECT
  count() OVER (PARTITION BY i) AS x, lag(x)
FROM
  changelog(t1, i)

Query id: d7445ff9-15a5-4986-b8e3-938c32bf3b13

┌─explain───────────────────────────────────────────┐
│ SELECT                                            │
│   count() OVER (PARTITION BY i) AS x AS x, lag(x) │
│ FROM                                              │
│   changelog(t1, i)                                │
│ GROUP BY                                          │
│   i                                               │
└───────────────────────────────────────────────────┘

6 rows in set. Elapsed: 0.007 sec. 

unexpected result: count() OVER (PARTITION BY i) AS x AS x

How to reproduce

Error message and/or stacktrace

Additional context