fix(tsdb/cache): prepend ts col to load stt
This commit is contained in:
parent
9d3eb02f3c
commit
16ad59fb18
|
@ -885,6 +885,14 @@ static int32_t tsdbCacheLoadFromRaw(STsdb *pTsdb, tb_uid_t uid, SArray *pLastArr
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
rocksdb_writebatch_t *wb = NULL;
|
rocksdb_writebatch_t *wb = NULL;
|
||||||
SArray *pTmpColArray = NULL;
|
SArray *pTmpColArray = NULL;
|
||||||
|
|
||||||
|
SIdxKey *idxKey = taosArrayGet(remainCols, 0);
|
||||||
|
if (idxKey->key.cid != PRIMARYKEY_TIMESTAMP_COL_ID) {
|
||||||
|
SLastKey *key = &(SLastKey){.ltype = ltype, .uid = uid, .cid = PRIMARYKEY_TIMESTAMP_COL_ID};
|
||||||
|
|
||||||
|
taosArrayInsert(remainCols, 0, &(SIdxKey){0, *key});
|
||||||
|
}
|
||||||
|
|
||||||
int num_keys = TARRAY_SIZE(remainCols);
|
int num_keys = TARRAY_SIZE(remainCols);
|
||||||
int16_t *aCols = taosMemoryMalloc(num_keys * sizeof(int16_t));
|
int16_t *aCols = taosMemoryMalloc(num_keys * sizeof(int16_t));
|
||||||
int16_t *slotIds = taosMemoryMalloc(num_keys * sizeof(int16_t));
|
int16_t *slotIds = taosMemoryMalloc(num_keys * sizeof(int16_t));
|
||||||
|
@ -1875,7 +1883,7 @@ static int32_t lastIterOpen(SFSLastIter *iter, STFileSet *pFileSet, STsdb *pTsdb
|
||||||
.backward = 1,
|
.backward = 1,
|
||||||
.pSttFileBlockIterArray = pr->pLDataIterArray,
|
.pSttFileBlockIterArray = pr->pLDataIterArray,
|
||||||
.pCols = aCols,
|
.pCols = aCols,
|
||||||
.numOfCols = nCols + 1,
|
.numOfCols = nCols,
|
||||||
.loadTombFn = loadSttTomb,
|
.loadTombFn = loadSttTomb,
|
||||||
.pReader = pr,
|
.pReader = pr,
|
||||||
.idstr = pr->idstr,
|
.idstr = pr->idstr,
|
||||||
|
|
Loading…
Reference in New Issue