提交 2dbd4b0e 编写于 作者: M Minglei Jin

[TS-927]<fix>(query): fix fill(linear) with null values

上级 413e3a7b
...@@ -101,7 +101,6 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, void** data, char** srcData ...@@ -101,7 +101,6 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, void** data, char** srcData
setNullValueForRow(pFillInfo, data, pFillInfo->numOfCols, index); setNullValueForRow(pFillInfo, data, pFillInfo->numOfCols, index);
} }
} else if (pFillInfo->type == TSDB_FILL_LINEAR) { } else if (pFillInfo->type == TSDB_FILL_LINEAR) {
// TODO : linear interpolation supports NULL value
if (prev != NULL && !outOfBound) { if (prev != NULL && !outOfBound) {
for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) { for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i]; SFillColInfo* pCol = &pFillInfo->pFillCol[i];
...@@ -121,6 +120,10 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, void** data, char** srcData ...@@ -121,6 +120,10 @@ static void doFillOneRowResult(SFillInfo* pFillInfo, void** data, char** srcData
bool exceedMax = false, exceedMin = false; bool exceedMax = false, exceedMin = false;
point1 = (SPoint){.key = *(TSKEY*)(prev), .val = prev + pCol->col.offset}; point1 = (SPoint){.key = *(TSKEY*)(prev), .val = prev + pCol->col.offset};
point2 = (SPoint){.key = ts, .val = srcData[i] + pFillInfo->index * bytes}; point2 = (SPoint){.key = ts, .val = srcData[i] + pFillInfo->index * bytes};
if (isNull(point1.val, type) || isNull(point2.val, type)) {
setNull(val1, pCol->col.type, bytes);
continue;
}
point = (SPoint){.key = pFillInfo->currentKey, .val = val1}; point = (SPoint){.key = pFillInfo->currentKey, .val = val1};
taosGetLinearInterpolationVal(&point, type, &point1, &point2, type, &exceedMax, &exceedMin); taosGetLinearInterpolationVal(&point, type, &point1, &point2, type, &exceedMax, &exceedMin);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册