refactor(query): refactor stream scanner to be adaptive to be involved schema.
This commit is contained in:
parent
9225155119
commit
43b5bf8333
|
@ -573,14 +573,27 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator, bool* newgroup)
|
||||||
|
|
||||||
int32_t numOfCols = pInfo->pRes->info.numOfCols;
|
int32_t numOfCols = pInfo->pRes->info.numOfCols;
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
SColumnInfoData* p = taosArrayGet(pCols, i);
|
SColMatchInfo* pColMatchInfo = taosArrayGet(pInfo->pColMatchInfo, i);
|
||||||
SColMatchInfo* pColMatchInfo = taosArrayGet(pInfo->pColMatchInfo, i);
|
|
||||||
if (!pColMatchInfo->output) {
|
if (!pColMatchInfo->output) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(pColMatchInfo->colId == p->info.colId);
|
bool colExists = false;
|
||||||
taosArraySet(pInfo->pRes->pDataBlock, pColMatchInfo->targetSlotId, p);
|
for(int32_t j = 0; j < taosArrayGetSize(pCols); ++j) {
|
||||||
|
SColumnInfoData* pResCol = taosArrayGet(pCols, j);
|
||||||
|
if (pResCol->info.colId == pColMatchInfo->colId) {
|
||||||
|
taosArraySet(pInfo->pRes->pDataBlock, pColMatchInfo->targetSlotId, pResCol);
|
||||||
|
colExists = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// the required column does not exists in submit block, let's set it to be all null value
|
||||||
|
if (!colExists) {
|
||||||
|
SColumnInfoData* pDst = taosArrayGet(pInfo->pRes->pDataBlock, pColMatchInfo->targetSlotId);
|
||||||
|
colInfoDataEnsureCapacity(pDst, 0, pBlockInfo->rows);
|
||||||
|
colDataAppendNNULL(pDst, 0, pBlockInfo->rows);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInfo->pRes->pDataBlock == NULL) {
|
if (pInfo->pRes->pDataBlock == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue