fix: block data load issue

This commit is contained in:
dapan1121 2024-02-27 18:55:21 +08:00
parent 521c96913e
commit 479279b75e
3 changed files with 59 additions and 2 deletions

View File

@ -3129,7 +3129,7 @@ int32_t mJoinInitMergeCtx(SMJoinOperatorInfo* pJoin, SSortMergeJoinPhysiNode* pJ
pCtx->finBlk = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc); pCtx->finBlk = createDataBlockFromDescNode(pJoinNode->node.pOutputDataBlockDesc);
blockDataEnsureCapacity(pCtx->finBlk, TMAX(MJOIN_DEFAULT_BLK_ROWS_NUM, MJOIN_BLK_SIZE_LIMIT/pJoinNode->node.pOutputDataBlockDesc->totalRowSize)); blockDataEnsureCapacity(pCtx->finBlk, TMAX(MJOIN_DEFAULT_BLK_ROWS_NUM, MJOIN_BLK_SIZE_LIMIT/pJoinNode->node.pOutputDataBlockDesc->totalRowSize));
if (pJoin->pFPreFilter) { if (pJoin->pFPreFilter) {
pCtx->midBlk = createOneDataBlock(pCtx->finBlk, false); pCtx->midBlk = createOneDataBlock(pCtx->finBlk, false);
blockDataEnsureCapacity(pCtx->midBlk, pCtx->finBlk->info.capacity); blockDataEnsureCapacity(pCtx->midBlk, pCtx->finBlk->info.capacity);

View File

@ -1393,7 +1393,8 @@ SSDataBlock* mJoinMainProcess(struct SOperatorInfo* pOperator) {
doFilter(pBlock, pJoin->pFinFilter, NULL); doFilter(pBlock, pJoin->pFinFilter, NULL);
} }
if (pBlock->info.rows > 0 || pOperator->status == OP_EXEC_DONE) { if (pBlock->info.rows > 0 || pOperator->status == OP_EXEC_DONE) {
pBlock->info.dataLoad = 1;
break; break;
} }
} }

View File

@ -902,7 +902,63 @@ if $data00 != 6 then
return -1 return -1
endi endi
sql select _wstart, count(*) from sta a left asof join sta b on a.ts <= b.ts and a.t1=b.t1 and a.col1=b.col1 jlimit 2 interval(1s);
if $rows != 6 then
return -1
endi
if $data00 != @23-11-17 16:29:00.000@ then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data10 != @23-11-17 16:29:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data20 != @23-11-17 16:29:02.000@ then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data30 != @23-11-17 16:29:03.000@ then
return -1
endi
if $data31 != 2 then
return -1
endi
if $data40 != @23-11-17 16:29:04.000@ then
return -1
endi
if $data41 != 1 then
return -1
endi
if $data50 != @23-11-17 16:29:05.000@ then
return -1
endi
if $data51 != 1 then
return -1
endi
sql select _wstart, count(*) from sta a left asof join sta b on a.ts <= b.ts and a.t1=b.t1 and a.col1=b.col1 jlimit 2 interval(1s) having(count(*) > 1);
if $rows != 2 then
return -1
endi
if $data00 != @23-11-17 16:29:00.000@ then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data10 != @23-11-17 16:29:03.000@ then
return -1
endi
if $data11 != 2 then
return -1
endi
sql_error select a.ts, b.ts from sta a left asof join sta b on a.ts >=b.ts and a.col1=a.ts; sql_error select a.ts, b.ts from sta a left asof join sta b on a.ts >=b.ts and a.col1=a.ts;
sql_error select a.ts, b.ts from sta a left asof join sta b on a.ts >=b.ts and a.col1 > 1; sql_error select a.ts, b.ts from sta a left asof join sta b on a.ts >=b.ts and a.col1 > 1;