feat: update support merge in mem
This commit is contained in:
parent
931b9436ad
commit
319d2785ab
|
@ -1613,6 +1613,7 @@ static int32_t mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capa
|
||||||
SCellVal sVal = {0};
|
SCellVal sVal = {0};
|
||||||
TSKEY rowKey = TSKEY_INITIAL_VAL;
|
TSKEY rowKey = TSKEY_INITIAL_VAL;
|
||||||
int32_t nResult = 0;
|
int32_t nResult = 0;
|
||||||
|
bool isMerge = true;
|
||||||
|
|
||||||
// the schema version info is embeded in STSRow
|
// the schema version info is embeded in STSRow
|
||||||
int32_t numOfColsOfRow1 = 0;
|
int32_t numOfColsOfRow1 = 0;
|
||||||
|
@ -1708,6 +1709,7 @@ static int32_t mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capa
|
||||||
if (colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
|
if (colId == PRIMARYKEY_TIMESTAMP_COL_ID) {
|
||||||
rowKey = *(TSKEY*)sVal.val;
|
rowKey = *(TSKEY*)sVal.val;
|
||||||
if (rowKey != *lastRowKey) {
|
if (rowKey != *lastRowKey) {
|
||||||
|
isMerge = false;
|
||||||
if (*lastRowKey != TSKEY_INITIAL_VAL) {
|
if (*lastRowKey != TSKEY_INITIAL_VAL) {
|
||||||
++(*curRow);
|
++(*curRow);
|
||||||
}
|
}
|
||||||
|
@ -1722,6 +1724,7 @@ static int32_t mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capa
|
||||||
tdSKvRowGetVal(row, PRIMARYKEY_TIMESTAMP_COL_ID, -1, -1, &sVal);
|
tdSKvRowGetVal(row, PRIMARYKEY_TIMESTAMP_COL_ID, -1, -1, &sVal);
|
||||||
rowKey = *(TSKEY*)sVal.val;
|
rowKey = *(TSKEY*)sVal.val;
|
||||||
if (rowKey != *lastRowKey) {
|
if (rowKey != *lastRowKey) {
|
||||||
|
isMerge = false;
|
||||||
if (*lastRowKey != TSKEY_INITIAL_VAL) {
|
if (*lastRowKey != TSKEY_INITIAL_VAL) {
|
||||||
++(*curRow);
|
++(*curRow);
|
||||||
}
|
}
|
||||||
|
@ -1745,7 +1748,7 @@ static int32_t mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capa
|
||||||
colDataAppend(pColInfo, *curRow, NULL, true);
|
colDataAppend(pColInfo, *curRow, NULL, true);
|
||||||
} else if (tdValTypeIsNone(sVal.valType)) {
|
} else if (tdValTypeIsNone(sVal.valType)) {
|
||||||
// TODO: Set null if nothing append for this row
|
// TODO: Set null if nothing append for this row
|
||||||
if (*lastRowKey != rowKey) {
|
if (!isMerge) {
|
||||||
colDataAppend(pColInfo, *curRow, NULL, true);
|
colDataAppend(pColInfo, *curRow, NULL, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1760,7 +1763,7 @@ static int32_t mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capa
|
||||||
++k;
|
++k;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (*lastRowKey != rowKey) {
|
if (!isMerge) {
|
||||||
colDataAppend(pColInfo, *curRow, NULL, true);
|
colDataAppend(pColInfo, *curRow, NULL, true);
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
|
|
Loading…
Reference in New Issue