Merge pull request #17180 from taosdata/feature/3_liaohj
fix(query): handle the block read case.
This commit is contained in:
commit
05a1773503
|
@ -926,6 +926,7 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fill the mis-matched columns with null value
|
||||||
while (i < numOfOutputCols) {
|
while (i < numOfOutputCols) {
|
||||||
pColData = taosArrayGet(pResBlock->pDataBlock, i);
|
pColData = taosArrayGet(pResBlock->pDataBlock, i);
|
||||||
colDataAppendNNULL(pColData, 0, remain);
|
colDataAppendNNULL(pColData, 0, remain);
|
||||||
|
@ -935,12 +936,15 @@ static int32_t copyBlockDataToSDataBlock(STsdbReader* pReader, STableBlockScanIn
|
||||||
pResBlock->info.rows = remain;
|
pResBlock->info.rows = remain;
|
||||||
pDumpInfo->rowIndex += step * remain;
|
pDumpInfo->rowIndex += step * remain;
|
||||||
|
|
||||||
|
// check if current block are all handled
|
||||||
if (pDumpInfo->rowIndex >= 0 && pDumpInfo->rowIndex < pBlock->nRow) {
|
if (pDumpInfo->rowIndex >= 0 && pDumpInfo->rowIndex < pBlock->nRow) {
|
||||||
// int64_t ts = pBlockData->aTSKEY[pDumpInfo->rowIndex];
|
int64_t ts = pBlockData->aTSKEY[pDumpInfo->rowIndex];
|
||||||
// setBlockAllDumped(pDumpInfo, ts, pReader->order);
|
if (outOfTimeWindow(ts, &pReader->window)) { // the remain data has out of query time window, ignore current block
|
||||||
|
setBlockAllDumped(pDumpInfo, ts, pReader->order);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
int64_t k = asc ? pBlock->maxKey.ts : pBlock->minKey.ts;
|
int64_t ts = asc ? pBlock->maxKey.ts : pBlock->minKey.ts;
|
||||||
setBlockAllDumped(pDumpInfo, k, pReader->order);
|
setBlockAllDumped(pDumpInfo, ts, pReader->order);
|
||||||
}
|
}
|
||||||
|
|
||||||
double elapsedTime = (taosGetTimestampUs() - st) / 1000.0;
|
double elapsedTime = (taosGetTimestampUs() - st) / 1000.0;
|
||||||
|
|
Loading…
Reference in New Issue