提交 319d2785 编写于 作者: C Cary Xu

feat: update support merge in mem

上级 931b9436
...@@ -1613,6 +1613,7 @@ static int32_t mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capa ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册