enh(query): add selectivity support for mavg functions
TD-18050
This commit is contained in:
parent
62407b9e9f
commit
3ebd338097
|
@ -2499,7 +2499,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
|
||||||
{
|
{
|
||||||
.name = "mavg",
|
.name = "mavg",
|
||||||
.type = FUNCTION_TYPE_MAVG,
|
.type = FUNCTION_TYPE_MAVG,
|
||||||
.classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC,
|
.classification = FUNC_MGT_INDEFINITE_ROWS_FUNC | FUNC_MGT_SELECT_FUNC | FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_FORBID_STREAM_FUNC,
|
||||||
.translateFunc = translateMavg,
|
.translateFunc = translateMavg,
|
||||||
.getEnvFunc = getMavgFuncEnv,
|
.getEnvFunc = getMavgFuncEnv,
|
||||||
.initFunc = mavgFunctionSetup,
|
.initFunc = mavgFunctionSetup,
|
||||||
|
|
|
@ -4858,6 +4858,11 @@ int32_t mavgFunction(SqlFunctionCtx* pCtx) {
|
||||||
colDataAppend(pOutput, pos, (char*)&result, false);
|
colDataAppend(pOutput, pos, (char*)&result, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle selectivity
|
||||||
|
if (pCtx->subsidiaries.num > 0) {
|
||||||
|
appendSelectivityValue(pCtx, i, pos);
|
||||||
|
}
|
||||||
|
|
||||||
numOfElems++;
|
numOfElems++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue