fix(query): keep block order in exchange operator.
This commit is contained in:
parent
257137e55e
commit
965ee9a6c8
|
@ -182,10 +182,15 @@ static SSDataBlock* doLoadRemoteDataImpl(SOperatorInfo* pOperator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// we have buffered retrieved datablock, return it directly
|
// we have buffered retrieved datablock, return it directly
|
||||||
SSDataBlock** p = taosArrayPop(pExchangeInfo->pResultBlockList);
|
SSDataBlock* p = NULL;
|
||||||
|
if (taosArrayGetSize(pExchangeInfo->pResultBlockList) > 0) {
|
||||||
|
p = taosArrayGetP(pExchangeInfo->pResultBlockList, 0);
|
||||||
|
taosArrayRemove(pExchangeInfo->pResultBlockList, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
taosArrayPush(pExchangeInfo->pRecycledBlocks, p);
|
taosArrayPush(pExchangeInfo->pRecycledBlocks, &p);
|
||||||
return *p;
|
return p;
|
||||||
} else {
|
} else {
|
||||||
if (pExchangeInfo->seqLoadData) {
|
if (pExchangeInfo->seqLoadData) {
|
||||||
seqLoadRemoteData(pOperator);
|
seqLoadRemoteData(pOperator);
|
||||||
|
@ -196,9 +201,10 @@ static SSDataBlock* doLoadRemoteDataImpl(SOperatorInfo* pOperator) {
|
||||||
if (taosArrayGetSize(pExchangeInfo->pResultBlockList) == 0) {
|
if (taosArrayGetSize(pExchangeInfo->pResultBlockList) == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
p = taosArrayPop(pExchangeInfo->pResultBlockList);
|
p = taosArrayGetP(pExchangeInfo->pResultBlockList, 0);
|
||||||
|
taosArrayRemove(pExchangeInfo->pResultBlockList, 0);
|
||||||
taosArrayPush(pExchangeInfo->pRecycledBlocks, p);
|
taosArrayPush(pExchangeInfo->pRecycledBlocks, p);
|
||||||
return *p;
|
return p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -801,7 +801,7 @@ STupleHandle* tsortNextTuple(SSortHandle* pHandle) {
|
||||||
index = tMergeTreeGetChosenIndex(pHandle->pMergeTree);
|
index = tMergeTreeGetChosenIndex(pHandle->pMergeTree);
|
||||||
pSource = pHandle->cmpParam.pSources[index];
|
pSource = pHandle->cmpParam.pSources[index];
|
||||||
|
|
||||||
assert(pSource->src.pBlock != NULL);
|
ASSERT(pSource->src.pBlock != NULL);
|
||||||
|
|
||||||
pHandle->tupleHandle.rowIndex = pSource->src.rowIndex;
|
pHandle->tupleHandle.rowIndex = pSource->src.rowIndex;
|
||||||
pHandle->tupleHandle.pBlock = pSource->src.pBlock;
|
pHandle->tupleHandle.pBlock = pSource->src.pBlock;
|
||||||
|
|
|
@ -649,7 +649,7 @@ static void doExtractVal(SColumnInfoData* pCol, int32_t i, int32_t end, SqlFunct
|
||||||
}
|
}
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_INT: {
|
case TSDB_DATA_TYPE_INT: {
|
||||||
const int16_t* pData = (const int16_t*)pCol->pData;
|
const int32_t* pData = (const int32_t*)pCol->pData;
|
||||||
__COMPARE_ACQUIRED_MAX(i, end, pCol->nullbitmap, pData, pCtx, *(int32_t*)&(pBuf->v), &pBuf->tuplePos)
|
__COMPARE_ACQUIRED_MAX(i, end, pCol->nullbitmap, pData, pCtx, *(int32_t*)&(pBuf->v), &pBuf->tuplePos)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#include "tarray.h"
|
#include "tarray.h"
|
||||||
#include "tcoding.h"
|
#include "tcoding.h"
|
||||||
|
|
||||||
|
// todo refactor API
|
||||||
|
|
||||||
SArray* taosArrayInit(size_t size, size_t elemSize) {
|
SArray* taosArrayInit(size_t size, size_t elemSize) {
|
||||||
assert(elemSize > 0);
|
assert(elemSize > 0);
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,10 @@ if $row != 12800 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print $data00 , $data01
|
||||||
|
|
||||||
if $data00 != @select_tags_tb0@ then
|
if $data00 != @select_tags_tb0@ then
|
||||||
|
print expect select_tags_tb0 , actual: $data00
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue