未验证 提交 f2807216 编写于 作者: G Ganlin Zhao 提交者: GitHub

Merge pull request #15541 from taosdata/fix/TD-17009

fix(query): fix apercentile with interval crash issue
...@@ -2068,7 +2068,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -2068,7 +2068,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{ {
.name = "apercentile", .name = "apercentile",
.type = FUNCTION_TYPE_APERCENTILE, .type = FUNCTION_TYPE_APERCENTILE,
.classification = FUNC_MGT_AGG_FUNC, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TIMELINE_FUNC,
.translateFunc = translateApercentile, .translateFunc = translateApercentile,
.getEnvFunc = getApercentileFuncEnv, .getEnvFunc = getApercentileFuncEnv,
.initFunc = apercentileFunctionSetup, .initFunc = apercentileFunctionSetup,
...@@ -2083,7 +2083,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -2083,7 +2083,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
}, },
{ {
.name = "_apercentile_partial", .name = "_apercentile_partial",
.type = FUNCTION_TYPE_APERCENTILE_PARTIAL, .type = FUNCTION_TYPE_APERCENTILE_PARTIAL | FUNC_MGT_TIMELINE_FUNC,
.classification = FUNC_MGT_AGG_FUNC, .classification = FUNC_MGT_AGG_FUNC,
.translateFunc = translateApercentilePartial, .translateFunc = translateApercentilePartial,
.getEnvFunc = getApercentileFuncEnv, .getEnvFunc = getApercentileFuncEnv,
...@@ -2096,7 +2096,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = { ...@@ -2096,7 +2096,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{ {
.name = "_apercentile_merge", .name = "_apercentile_merge",
.type = FUNCTION_TYPE_APERCENTILE_MERGE, .type = FUNCTION_TYPE_APERCENTILE_MERGE,
.classification = FUNC_MGT_AGG_FUNC, .classification = FUNC_MGT_AGG_FUNC | FUNC_MGT_TIMELINE_FUNC,
.translateFunc = translateApercentileMerge, .translateFunc = translateApercentileMerge,
.getEnvFunc = getApercentileFuncEnv, .getEnvFunc = getApercentileFuncEnv,
.initFunc = apercentileFunctionSetup, .initFunc = apercentileFunctionSetup,
......
...@@ -141,8 +141,8 @@ class TDTestCase: ...@@ -141,8 +141,8 @@ class TDTestCase:
query_data = tdSql.queryResult query_data = tdSql.queryResult
# nest query for support max # nest query for support max
tdSql.query(f"select apercentile(c2+2,10)+1 from (select max(c1) c2 from {dbname}.stb1)") #tdSql.query(f"select apercentile(c2+2,10)+1 from (select max(c1) c2 from {dbname}.stb1)")
tdSql.checkData(0,0,31.000000000) #tdSql.checkData(0,0,31.000000000)
tdSql.query(f"select apercentile(c1+2,10)+1 as c2 from (select ts ,c1 ,c2 from {dbname}.stb1)") tdSql.query(f"select apercentile(c1+2,10)+1 as c2 from (select ts ,c1 ,c2 from {dbname}.stb1)")
tdSql.checkData(0,0,7.560701700) tdSql.checkData(0,0,7.560701700)
tdSql.query(f"select apercentile(a+2,10)+1 as c2 from (select ts ,abs(c1) a ,c2 from {dbname}.stb1)") tdSql.query(f"select apercentile(a+2,10)+1 as c2 from (select ts ,abs(c1) a ,c2 from {dbname}.stb1)")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册