fix(query):use window start key when ts column is null
This commit is contained in:
parent
f6efd0a36c
commit
aa80aa39bc
|
@ -280,6 +280,7 @@ bool fmIsSkipScanCheckFunc(int32_t funcId);
|
|||
bool fmIsPrimaryKeyFunc(int32_t funcId);
|
||||
bool fmIsProcessByRowFunc(int32_t funcId);
|
||||
bool fmisSelectGroupConstValueFunc(int32_t funcId);
|
||||
bool fmIsElapsedFunc(int32_t funcId);
|
||||
|
||||
void getLastCacheDataType(SDataType* pType, int32_t pkBytes);
|
||||
int32_t createFunction(const char* pName, SNodeList* pParameterList, SFunctionNode** pFunc);
|
||||
|
|
|
@ -293,7 +293,9 @@ void doTimeWindowInterpolation(SArray* pPrevValues, SArray* pDataBlock, TSKEY pr
|
|||
SPoint point2 = (SPoint){.key = curTs, .val = &v2};
|
||||
SPoint point = (SPoint){.key = windowKey, .val = &v};
|
||||
|
||||
taosGetLinearInterpolationVal(&point, TSDB_DATA_TYPE_DOUBLE, &point1, &point2, TSDB_DATA_TYPE_DOUBLE);
|
||||
if (!fmIsElapsedFunc(pCtx[k].functionId)) {
|
||||
taosGetLinearInterpolationVal(&point, TSDB_DATA_TYPE_DOUBLE, &point1, &point2, TSDB_DATA_TYPE_DOUBLE);
|
||||
}
|
||||
|
||||
if (type == RESULT_ROW_START_INTERP) {
|
||||
pCtx[k].start.key = point.key;
|
||||
|
@ -639,7 +641,11 @@ static void doInterpUnclosedTimeWindow(SOperatorInfo* pOperatorInfo, int32_t num
|
|||
|
||||
int64_t prevTs = *(int64_t*)pTsKey->pData;
|
||||
if (groupId == pBlock->info.id.groupId) {
|
||||
doTimeWindowInterpolation(pInfo->pPrevValues, pBlock->pDataBlock, prevTs, -1, tsCols[startPos], startPos, w.ekey,
|
||||
TSKEY curTs = pBlock->info.window.skey;
|
||||
if (tsCols != NULL) {
|
||||
curTs = tsCols[startPos];
|
||||
}
|
||||
doTimeWindowInterpolation(pInfo->pPrevValues, pBlock->pDataBlock, prevTs, -1, curTs, startPos, w.ekey,
|
||||
RESULT_ROW_END_INTERP, pSup);
|
||||
}
|
||||
|
||||
|
|
|
@ -276,6 +276,13 @@ bool fmisSelectGroupConstValueFunc(int32_t funcId) {
|
|||
return FUNCTION_TYPE_GROUP_CONST_VALUE == funcMgtBuiltins[funcId].type;
|
||||
}
|
||||
|
||||
bool fmIsElapsedFunc(int32_t funcId) {
|
||||
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
|
||||
return false;
|
||||
}
|
||||
return FUNCTION_TYPE_ELAPSED == funcMgtBuiltins[funcId].type;
|
||||
}
|
||||
|
||||
bool fmIsBlockDistFunc(int32_t funcId) {
|
||||
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue