more row refact
This commit is contained in:
parent
28fa84b1d6
commit
9d0563df3e
|
@ -259,10 +259,6 @@ void tdResetTSchemaBuilder(STSchemaBuilder *pBuilder, schema_ver_t version)
|
||||||
int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, col_id_t colId, col_bytes_t bytes);
|
int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, col_id_t colId, col_bytes_t bytes);
|
||||||
STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder);
|
STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder);
|
||||||
|
|
||||||
// ----------------- Semantic timestamp key definition
|
|
||||||
#define MIN_TS_KEY ((TSKEY)0x8000000000000001)
|
|
||||||
#define MAX_TS_KEY ((TSKEY)0x7fffffffffffffff)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ static void copyTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBl
|
||||||
|
|
||||||
static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, const char* tval) {
|
static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, const char* tval) {
|
||||||
// the data is loaded, not only the block SMA value
|
// the data is loaded, not only the block SMA value
|
||||||
for(int32_t i = start; i < num + start; ++i) {
|
for (int32_t i = start; i < num + start; ++i) {
|
||||||
char* p = colDataGetData(pCol, i);
|
char* p = colDataGetData(pCol, i);
|
||||||
if (memcpy((void*)tval, p, pCol->info.bytes) == 0) {
|
if (memcpy((void*)tval, p, pCol->info.bytes) == 0) {
|
||||||
return i;
|
return i;
|
||||||
|
@ -1092,7 +1092,6 @@ static int32_t findRowIndex(int32_t start, int32_t num, SColumnInfoData* pCol, c
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
|
int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
|
||||||
int32_t numOfElems = 0;
|
int32_t numOfElems = 0;
|
||||||
|
|
||||||
|
@ -1872,7 +1871,7 @@ int32_t stddevFunctionMerge(SqlFunctionCtx* pCtx) {
|
||||||
|
|
||||||
SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
SStddevRes* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx));
|
||||||
|
|
||||||
for(int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) {
|
for (int32_t i = pInput->startRowIndex; i < pInput->startRowIndex + pInput->numOfRows; ++i) {
|
||||||
char* data = colDataGetData(pCol, i);
|
char* data = colDataGetData(pCol, i);
|
||||||
SStddevRes* pInputInfo = (SStddevRes*)varDataVal(data);
|
SStddevRes* pInputInfo = (SStddevRes*)varDataVal(data);
|
||||||
stddevTransferInfo(pInputInfo, pInfo);
|
stddevTransferInfo(pInputInfo, pInfo);
|
||||||
|
@ -3465,8 +3464,7 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
|
||||||
setBufPageDirty(pPage, true);
|
setBufPageDirty(pPage, true);
|
||||||
releaseBufPage(pCtx->pBuf, pPage);
|
releaseBufPage(pCtx->pBuf, pPage);
|
||||||
#ifdef BUF_PAGE_DEBUG
|
#ifdef BUF_PAGE_DEBUG
|
||||||
qDebug("page_saveTuple pos:%p,pageId:%d, offset:%d\n", pPos, pPos->pageId,
|
qDebug("page_saveTuple pos:%p,pageId:%d, offset:%d\n", pPos, pPos->pageId, pPos->offset);
|
||||||
pPos->offset);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3765,7 +3763,7 @@ bool elapsedFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResultInfo
|
||||||
|
|
||||||
SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo);
|
SElapsedInfo* pInfo = GET_ROWCELL_INTERBUF(pResultInfo);
|
||||||
pInfo->result = 0;
|
pInfo->result = 0;
|
||||||
pInfo->min = MAX_TS_KEY;
|
pInfo->min = TSKEY_MAX;
|
||||||
pInfo->max = 0;
|
pInfo->max = 0;
|
||||||
|
|
||||||
if (pCtx->numOfParams > 1) {
|
if (pCtx->numOfParams > 1) {
|
||||||
|
@ -3792,7 +3790,7 @@ int32_t elapsedFunction(SqlFunctionCtx* pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInput->colDataAggIsSet) {
|
if (pInput->colDataAggIsSet) {
|
||||||
if (pInfo->min == MAX_TS_KEY) {
|
if (pInfo->min == TSKEY_MAX) {
|
||||||
pInfo->min = GET_INT64_VAL(&pAgg->min);
|
pInfo->min = GET_INT64_VAL(&pAgg->min);
|
||||||
pInfo->max = GET_INT64_VAL(&pAgg->max);
|
pInfo->max = GET_INT64_VAL(&pAgg->max);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue