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

Syntax error when select from the result of explain query #819

Open sunset3000 opened 3 months ago

sunset3000 commented 3 months ago

Describe what's wrong

  1. excute the below query, it reports syntax error
    
    create STREAM tab (a int32, b int32, c int32, d int32) engine = MergeTree order by (a, b, c);

insert into tab select 0, number % 3, 2 - int_div(number, 3), (number % 3 + 1) 10 from numbers(6); insert into tab select 0, number % 3, 2 - int_div(number, 3), (number % 3 + 1) 100 from numbers(6);

select * from (explain actions = 1, sorting=1 select a, any(b), c, d from tab where b = 1 group by a, c, d settings optimize_aggregation_in_order=1, query_plan_aggregation_in_order=1) where explain like '%Sorting (Stream)%' or explain like '%ReadFromMergeTree%' or explain like '%Aggregating%' or explain like '%Order:%';



Expected Result:
the above can run without problem.

**How to reproduce**

**Error message and/or stacktrace**
<!-- If applicable, add screenshots to help explain your problem. -->

**Additional context**
<!--Add any other context about the problem here. -->