提交 7db6081c 编写于 作者: X Xiaoyu Wang

feat: the function manager adds an interface for manually configuring the...

feat: the function manager adds an interface for manually configuring the parameters of the merge function
上级 04e9996d
......@@ -1737,7 +1737,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.combineFunc = topCombine,
.pPartialFunc = "_top_partial",
.pMergeFunc = "_top_merge",
.createMergeParaFuc = topCreateMergePara
// .createMergeParaFuc = topCreateMergePara
},
{
.name = "_top_partial",
......
......@@ -321,16 +321,18 @@ static int32_t createMergeFunction(const SFunctionNode* pSrcFunc, const SFunctio
if (TSDB_CODE_SUCCESS == code) {
// overwrite function restype set by translate function
if (fmIsSameInOutType(pSrcFunc->funcId)) {
(*pMergeFunc)->node.resType = pSrcFunc->node.resType;
pFunc->node.resType = pSrcFunc->node.resType;
}
strcpy((*pMergeFunc)->node.aliasName, pSrcFunc->node.aliasName);
strcpy(pFunc->node.aliasName, pSrcFunc->node.aliasName);
}
if (TSDB_CODE_SUCCESS == code) {
*pMergeFunc = pFunc;
} else {
pFunc->pParameterList = NULL;
nodesDestroyNode((SNode*)pFunc);
if (NULL != pFunc) {
pFunc->pParameterList = NULL;
nodesDestroyNode((SNode*)pFunc);
}
nodesDestroyList(pParameterList);
}
......
......@@ -52,6 +52,8 @@ TEST_F(PlanBasicTest, func) {
run("SELECT PERCENTILE(c1, 60) FROM t1");
run("SELECT TOP(c1, 60) FROM t1");
run("SELECT TOP(c1, 60) FROM st1");
}
TEST_F(PlanBasicTest, uniqueFunc) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册