refactor(query): do some internal refactor.
This commit is contained in:
parent
bd0523ddb9
commit
72e0f09dd2
|
@ -105,12 +105,16 @@ void tLDataIterNextBlock(SLDataIter *pIter) {
|
|||
size_t size = taosArrayGetSize(pIter->aBlockL);
|
||||
for(int32_t i = pIter->iBlockL; i < size && i >= 0; i += step) {
|
||||
SBlockL *p = taosArrayGet(pIter->aBlockL, i);
|
||||
if (p->minUid <= pIter->uid && p->maxUid >= pIter->uid) {
|
||||
index = i;
|
||||
if ((!pIter->backward) && p->minUid > pIter->uid) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (p->minUid > pIter->uid) {
|
||||
if (pIter->backward && p->maxUid < pIter->uid) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (p->minUid <= pIter->uid && p->maxUid >= pIter->uid) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -145,20 +149,25 @@ static void findNextValidRow(SLDataIter* pIter) {
|
|||
}
|
||||
|
||||
int64_t ts = pIter->bData.aTSKEY[i];
|
||||
if (ts < pIter->timeWindow.skey) {
|
||||
if (!pIter->backward) { // asc
|
||||
if (ts > pIter->timeWindow.ekey) { // no more data
|
||||
break;
|
||||
} else if (ts < pIter->timeWindow.skey) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (ts < pIter->timeWindow.skey) {
|
||||
break;
|
||||
} else if (ts > pIter->timeWindow.ekey) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t ver = pIter->bData.aVersion[i];
|
||||
if (ver < pIter->verRange.minVer) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// no data any more, todo opt handle desc case
|
||||
if (ts > pIter->timeWindow.ekey) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// todo opt handle desc case
|
||||
if (ver > pIter->verRange.maxVer) {
|
||||
continue;
|
||||
|
@ -235,8 +244,7 @@ _exit:
|
|||
}
|
||||
|
||||
SRowInfo *tLDataIterGet(SLDataIter *pIter) {
|
||||
// TODO
|
||||
return NULL;
|
||||
return &pIter->rInfo;
|
||||
}
|
||||
|
||||
// SMergeTree =================================================
|
||||
|
|
|
@ -636,6 +636,7 @@ static int32_t doLoadFileBlock(STsdbReader* pReader, SArray* pIndexList, SArray*
|
|||
|
||||
{
|
||||
// 1. time range check
|
||||
printf("%ld, %ld\n", pLastBlock->minKey, pLastBlock->maxKey);
|
||||
if (pLastBlock->minKey > pReader->window.ekey || pLastBlock->maxKey < pReader->window.skey) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue