diff --git a/source/libs/executor/src/projectoperator.c b/source/libs/executor/src/projectoperator.c index dd7f9b77f396895f1e138b44e9bac1081012ddb6..de353b4bac837ecc544c179f40acede17741cc38 100644 --- a/source/libs/executor/src/projectoperator.c +++ b/source/libs/executor/src/projectoperator.c @@ -317,7 +317,7 @@ SSDataBlock* doProjectOperation(SOperatorInfo* pOperator) { if (pProjectInfo->mergeDataBlocks) { if (pRes->info.rows > 0) { - pFinalRes->info.id.groupId = pRes->info.id.groupId; + pFinalRes->info.id.groupId = 0; //clear groupId pFinalRes->info.version = pRes->info.version; // continue merge data, ignore the group id diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 336cc60a0c23bb0563c93731f14423b9f9e0f9e1..57fff095e87ea2ecc231dc5c4489de567c5598cc 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -175,6 +175,7 @@ ,,y,script,./test.sh -f tsim/query/session.sim ,,y,script,./test.sh -f tsim/query/udf.sim ,,y,script,./test.sh -f tsim/query/udf_with_const.sim +,,y,script,./test.sh -f tsim/query/groupby.sim ,,y,script,./test.sh -f tsim/qnode/basic1.sim ,,y,script,./test.sh -f tsim/snode/basic1.sim ,,y,script,./test.sh -f tsim/mnode/basic1.sim diff --git a/tests/script/tsim/parser/fill.sim b/tests/script/tsim/parser/fill.sim index b0841d6712bbbe8af47ae17c3b3c5fc9d7e3a290..0510f80419413d893c5172e34b441dd25de0fb9b 100644 --- a/tests/script/tsim/parser/fill.sim +++ b/tests/script/tsim/parser/fill.sim @@ -1075,16 +1075,11 @@ if $loop_count == 20 then return -1 endi -if $data00 != 20026 then +if $data00 != 40052 then print =====data00=$data00 goto loop0 endi -if $data10 != 20026 then - print =====data10=$data10 - goto loop0 -endi - sql select _wstart, count(a) from st where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(prev); if $rows != 40052 then diff --git a/tests/script/tsim/query/groupby.sim b/tests/script/tsim/query/groupby.sim new file mode 100644 index 0000000000000000000000000000000000000000..03bea4d0470fbb6c9d8280012fdbbc3273b6fd96 --- /dev/null +++ b/tests/script/tsim/query/groupby.sim @@ -0,0 +1,23 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + + +sql drop database if exists db1; +sql create database db1; +sql use db1; +sql create table test(pos_time TIMESTAMP,target_id INT ,data DOUBLE) tags(scene_id BIGINT,data_stage VARCHAR(64),data_source VARCHAR(64)); + +sql insert into _413254290_108_1001_ using test tags(108,'1001','') values(1667232060000,413254290,1); +sql insert into _413254290_108_1001_ using test tags(108,'1001','') values(1667232061000,413254290,2); +sql insert into _413254290_108_1001_ using test tags(108,'1001','') values(1667232062000,413254290,3); +sql insert into _413254000_108_1001_ using test tags(109,'1001','') values(1667232060000,413254290,3); +sql insert into _413254000_108_1001_ using test tags(109,'1001','') values(1667232062000,413254290,3); + +sql select target_name,max(time_diff) AS time_diff,(count(1)) AS track_count from (select tbname as target_name,diff(pos_time) time_diff from test where tbname in ('_413254290_108_1001_','_413254000_108_1001_') partition by tbname) a group by target_name; +if $rows != 2 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT