提交 1e503061 编写于 作者: G Ganlin Zhao

feat(query): add mavg function

上级 8d21c662
......@@ -3013,7 +3013,6 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) {
} else {
pInfo->sum = pInfo->sum + v - pInfo->points[pInfo->pos];
}
}
pInfo->points[pInfo->pos] = v;
double result = pInfo->sum / pInfo->numOfPoints;
......@@ -3023,9 +3022,14 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) {
if (pTsOutput != NULL) {
colDataAppendInt64(pTsOutput, pos, &tsList[i]);
}
numOfElems++;
}
pInfo->pos++;
if (pInfo->pos == pInfo->numOfPoints) {
pInfo->pos = 0;
}
}
return numOfElems;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册