diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 33dc3a2469d79fab1035731cfeb5178f5c7a26d1..44d261bd3145b2760a215611c31dd20dc5b8d4d9 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -192,6 +192,9 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, uint32_t numOfRow1, co return numOfRow1; } + if (pSource->hasNull) { + pColumnInfoData->hasNull = pSource->hasNull; + } if (IS_VAR_DATA_TYPE(pColumnInfoData->info.type)) { // Handle the bitmap char* p = taosMemoryRealloc(pColumnInfoData->varmeta.offset, sizeof(int32_t) * (numOfRow1 + numOfRow2)); @@ -313,9 +316,9 @@ int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock) { } int32_t blockDataMerge(SSDataBlock* pDest, const SSDataBlock* pSrc) { - assert(pSrc != NULL && pDest != NULL && pDest->info.numOfCols == pSrc->info.numOfCols); + assert(pSrc != NULL && pDest != NULL); - int32_t numOfCols = pSrc->info.numOfCols; + int32_t numOfCols = pDest->info.numOfCols; for (int32_t i = 0; i < numOfCols; ++i) { SColumnInfoData* pCol2 = taosArrayGet(pDest->pDataBlock, i); SColumnInfoData* pCol1 = taosArrayGet(pSrc->pDataBlock, i); diff --git a/source/libs/executor/inc/tsort.h b/source/libs/executor/inc/tsort.h index 3c7194de6fdea10548ab46dbb07503076d7a7f03..03bbe8098c0008d5122fdf7c1e1be823e3003559 100644 --- a/source/libs/executor/inc/tsort.h +++ b/source/libs/executor/inc/tsort.h @@ -52,6 +52,11 @@ typedef struct SMsortComparParam { SArray *orderInfo; // SArray } SMsortComparParam; +struct STupleHandle { + SSDataBlock* pBlock; + int32_t rowIndex; +}; + typedef struct SSortHandle SSortHandle; typedef struct STupleHandle STupleHandle; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 4cc1658e6454da698b8595efa56cc8bb9cba9c90..48b734f3aa14427ec708036210b1762eb53feb41 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -302,10 +302,6 @@ SSDataBlock* createOutputBuf_rv1(SDataBlockDescNode* pNode) { } taosArrayPush(pBlock->pDataBlock, &idata); - - if (IS_VAR_DATA_TYPE(idata.info.type)) { - pBlock->info.hasVarCol = true; - } } return pBlock; @@ -4748,7 +4744,8 @@ static void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHan for (int32_t i = 0; i < pBlock->info.numOfCols; ++i) { SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, i); - bool isNull = tsortIsNullVal(pTupleHandle, i); + SColumnInfoData* pColInfoSrc = taosArrayGet(pTupleHandle->pBlock->pDataBlock, i); + bool isNull = colDataIsNull(pColInfoSrc, 0, pTupleHandle->rowIndex, NULL); if (isNull) { colDataAppend(pColInfo, pBlock->info.rows, NULL, true); } else { diff --git a/source/libs/executor/src/tsort.c b/source/libs/executor/src/tsort.c index a052cbe846d28599f0e4a775d17e547363c04ca4..b226106e018c993037b79e603e7eca7175ae6123 100644 --- a/source/libs/executor/src/tsort.c +++ b/source/libs/executor/src/tsort.c @@ -24,11 +24,6 @@ #include "tutil.h" #include "tcompare.h" -struct STupleHandle { - SSDataBlock* pBlock; - int32_t rowIndex; -}; - struct SSortHandle { int32_t type;