From 2c24c52c80fb222f9481c4689fcbb804e481c966 Mon Sep 17 00:00:00 2001 From: 54liuyao <54liuyao@163.com> Date: Mon, 23 Sep 2024 13:45:38 +0800 Subject: [PATCH] fix(stream):not support group by --- source/libs/parser/src/parTranslater.c | 4 ++++ tests/script/tsim/stream/basic3.sim | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 0a871967cf..fe3e9b10da 100755 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -10599,6 +10599,10 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SCreateStreamStmt* pStm } } + if (NULL != pSelect->pGroupByList) { + return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_STREAM_QUERY, "Unsupported Group by"); + } + return TSDB_CODE_SUCCESS; } diff --git a/tests/script/tsim/stream/basic3.sim b/tests/script/tsim/stream/basic3.sim index 010578d4d2..6e195d63be 100644 --- a/tests/script/tsim/stream/basic3.sim +++ b/tests/script/tsim/stream/basic3.sim @@ -99,6 +99,18 @@ if $rows == 0 then return -1 endi +print ========== step2 + +sql CREATE DATABASE test2 VGROUPS 2; +sql use test2; + +sql CREATE STABLE st (time TIMESTAMP, ca DOUBLE, cb DOUBLE, cc int) TAGS (ta VARCHAR(10) ); + +sql_error create stream stream_t1 trigger at_once ignore update 0 ignore expired 0 into streamtST as select time, count(*) c1, count(1) c2 from st partition by tbname group by ca,time ; + +sql_error create stream stream_t1 trigger at_once ignore update 0 ignore expired 0 into streamtST as select _wstart, count(*) c1, count(1) c2 from st partition by tbname interval(10s) group by ca,time ; + + _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT print =============== check