add more code
This commit is contained in:
parent
5a3949eae8
commit
dc59712452
|
@ -122,7 +122,7 @@ extern void (*tColDataCalcSMA[])(SColData *pColData, int64_t *sum, int64_t *max,
|
||||||
|
|
||||||
// for stmt bind
|
// for stmt bind
|
||||||
int32_t tColDataAddValueByBind(SColData *pColData, TAOS_MULTI_BIND *pBind);
|
int32_t tColDataAddValueByBind(SColData *pColData, TAOS_MULTI_BIND *pBind);
|
||||||
int32_t tColDataSortMerge(SColData *aColData);
|
void tColDataSortMerge(SArray *colDataArr);
|
||||||
|
|
||||||
// for encode/decode
|
// for encode/decode
|
||||||
int32_t tPutColData(uint8_t *pBuf, SColData *pColData);
|
int32_t tPutColData(uint8_t *pBuf, SColData *pColData);
|
||||||
|
|
|
@ -2106,9 +2106,45 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tColDataSortMerge(SColData *aColData) {
|
void tColDataSortMerge(SArray *colDataArr) {
|
||||||
// todo
|
int32_t nColData = TARRAY_SIZE(colDataArr);
|
||||||
return 0;
|
SColData *aColData = (SColData *)TARRAY_DATA(colDataArr);
|
||||||
|
|
||||||
|
if (aColData[0].nVal <= 1) goto _exit;
|
||||||
|
|
||||||
|
ASSERT(aColData[0].type == TSDB_DATA_TYPE_TIMESTAMP);
|
||||||
|
ASSERT(aColData[0].cid == PRIMARYKEY_TIMESTAMP_COL_ID);
|
||||||
|
ASSERT(aColData[0].flag == HAS_VALUE);
|
||||||
|
|
||||||
|
int8_t doSort = 0;
|
||||||
|
int8_t doMerge = 0;
|
||||||
|
// scan -------
|
||||||
|
TSKEY *aKey = (TSKEY *)aColData[0].pData;
|
||||||
|
for (int32_t iVal = 1; iVal < aColData[0].nVal; ++iVal) {
|
||||||
|
if (aKey[iVal] > aKey[iVal - 1]) {
|
||||||
|
continue;
|
||||||
|
} else if (aKey[iVal] < aKey[iVal - 1]) {
|
||||||
|
doSort = 1;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
doMerge = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// sort -------
|
||||||
|
if (doSort) {
|
||||||
|
ASSERT(0);
|
||||||
|
// todo
|
||||||
|
}
|
||||||
|
|
||||||
|
// merge -------
|
||||||
|
if (doMerge) {
|
||||||
|
ASSERT(0);
|
||||||
|
// todo
|
||||||
|
}
|
||||||
|
|
||||||
|
_exit:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tPutColData(uint8_t *pBuf, SColData *pColData) {
|
int32_t tPutColData(uint8_t *pBuf, SColData *pColData) {
|
||||||
|
|
Loading…
Reference in New Issue