未验证 提交 6aed8932 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #18231 from taosdata/fix/TD-20428

fix:fill operator core
...@@ -1994,8 +1994,7 @@ static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo* pOperator, SFillOp ...@@ -1994,8 +1994,7 @@ static void doHandleRemainBlockForNewGroupImpl(SOperatorInfo* pOperator, SFillOp
int32_t scanFlag = MAIN_SCAN; int32_t scanFlag = MAIN_SCAN;
getTableScanInfo(pOperator, &order, &scanFlag); getTableScanInfo(pOperator, &order, &scanFlag);
int64_t ekey = int64_t ekey = pInfo->existNewGroupBlock->info.window.ekey;
Q_STATUS_EQUAL(pTaskInfo->status, TASK_COMPLETED) ? pInfo->win.ekey : pInfo->existNewGroupBlock->info.window.ekey;
taosResetFillInfo(pInfo->pFillInfo, getFillInfoStart(pInfo->pFillInfo)); taosResetFillInfo(pInfo->pFillInfo, getFillInfoStart(pInfo->pFillInfo));
blockDataCleanup(pInfo->pRes); blockDataCleanup(pInfo->pRes);
......
...@@ -4898,6 +4898,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) { ...@@ -4898,6 +4898,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) {
if (pMiaInfo->groupId == 0) { if (pMiaInfo->groupId == 0) {
if (pMiaInfo->groupId != pBlock->info.groupId) { if (pMiaInfo->groupId != pBlock->info.groupId) {
pMiaInfo->groupId = pBlock->info.groupId; pMiaInfo->groupId = pBlock->info.groupId;
pRes->info.groupId = pMiaInfo->groupId;
} }
} else { } else {
if (pMiaInfo->groupId != pBlock->info.groupId) { if (pMiaInfo->groupId != pBlock->info.groupId) {
...@@ -4911,6 +4912,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) { ...@@ -4911,6 +4912,7 @@ static void doMergeAlignedIntervalAgg(SOperatorInfo* pOperator) {
break; break;
} else { } else {
// continue // continue
pRes->info.groupId = pMiaInfo->groupId;
} }
} }
......
...@@ -1049,4 +1049,103 @@ print =============== clear ...@@ -1049,4 +1049,103 @@ print =============== clear
# return -1 # return -1
#endi #endi
print ============== fill
sql drop database if exists test;
sql create database test vgroups 4;
sql use test;
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql insert into t1 values(1648712211000,1,2,3);
sql insert into t1 values(1648712225000,2,2,3);
sql insert into t2 values(1648712212000,1,2,3);
sql insert into t2 values(1648712226000,2,2,3);
$loop_count = 0
loop0:
sleep 200
sql select count(*) from(select count(a) from st where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(value, -1));
$loop_count = $loop_count + 1
if $loop_count == 20 then
return -1
endi
if $data00 != 20026 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
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from st where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(next);
if $rows != 40052 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from st where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(linear);
if $rows != 40052 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from st where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(NULL);
if $rows != 40052 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from t1 where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(value, -1);
if $rows != 20026 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from t1 where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(NULL);
if $rows != 20026 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from t1 where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(prev);
if $rows != 20026 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from t1 where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(next);
if $rows != 20026 then
print =====rows=$rows
return -1
endi
sql select _wstart, count(a) from t1 where ts >= 1648712201000 and ts <= 1648732226000 partition by tbname interval(1s) fill(linear);
if $rows != 20026 then
print =====rows=$rows
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册