Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
43918a27
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
43918a27
编写于
11月 02, 2022
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(function):if data is null, apercentile function should return null
上级
77a6cf50
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
84 addition
and
2 deletion
+84
-2
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+16
-0
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+3
-1
tests/script/tsim/parser/function.sim
tests/script/tsim/parser/function.sim
+65
-1
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
43918a27
...
...
@@ -1913,6 +1913,22 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %25s |"
,
pBuf
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_TINYINT
:
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15d |"
,
*
(
int8_t
*
)
var
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15d |"
,
*
(
uint8_t
*
)
var
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15d |"
,
*
(
int16_t
*
)
var
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15d |"
,
*
(
uint16_t
*
)
var
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
break
;
case
TSDB_DATA_TYPE_INT
:
len
+=
snprintf
(
dumpBuf
+
len
,
size
-
len
,
" %15d |"
,
*
(
int32_t
*
)
var
);
if
(
len
>=
size
-
1
)
return
dumpBuf
;
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
43918a27
...
...
@@ -2713,7 +2713,9 @@ int32_t apercentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
taosMemoryFree
(
res
);
}
else
{
// no need to free
// setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes);
return
TSDB_CODE_SUCCESS
;
// return TSDB_CODE_SUCCESS;
qDebug
(
"%s get the final res, elements:%"
PRId64
", numOfEntry:%d. result is null"
,
__FUNCTION__
,
pInfo
->
pHisto
->
numOfElems
,
pInfo
->
pHisto
->
numOfEntries
);
}
}
...
...
tests/script/tsim/parser/function.sim
浏览文件 @
43918a27
...
...
@@ -1013,4 +1013,68 @@ sql_error select sum(cast(_wend as bigint)), a from ft1 state_window(a);
sql_error create stream streams1 trigger at_once into streamt as select _wstart, sum(_wduration) from ft1 interval(10s);
sql_error create stream streams1 trigger at_once into streamt as select _wstart, sum(cast(_wend as bigint)) from ft1 interval(10s);
\ No newline at end of file
sql_error create stream streams1 trigger at_once into streamt as select _wstart, sum(cast(_wend as bigint)) from ft1 interval(10s);
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double);
sql insert into t1 values(1648791213000,1,1,3,1.0);
sql insert into t1 values(1648791223000,1,2,NULL,NULL);
sleep 200
sql select apercentile(c, 50), apercentile(d, 50, "t-digest") from t1;
if $data00 != 3.000000000 then
print ======data00=$data00
return -1
endi
if $data01 != 1.000000000 then
print ======data01=$data01
return -1
endi
sql select apercentile(c, 50) a, apercentile(d, 50, "t-digest") from t1 partition by b session(ts, 5s) order by a desc;
if $data00 != 3.000000000 then
print ======data00=$data00
return -1
endi
if $data01 != 1.000000000 then
print ======data01=$data01
return -1
endi
if $data10 != NULL then
print ======data10=$data10
return -1
endi
if $data11 != NULL then
print ======data11=$data11
return -1
endi
sql select apercentile(c, 50) a, apercentile(d, 50, "t-digest") from t1 state_window(b) order by a desc;
if $data00 != 3.000000000 then
print ======data00=$data00
return -1
endi
if $data01 != 1.000000000 then
print ======data01=$data01
return -1
endi
if $data10 != NULL then
print ======data10=$data10
return -1
endi
if $data11 != NULL then
print ======data11=$data11
return -1
endi
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录