Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
39a58c35
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看板
未验证
提交
39a58c35
编写于
7月 10, 2023
作者:
D
dapan1121
提交者:
GitHub
7月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22008 from taosdata/fix/TS-3648
fix: fix interp fill value unsigned type not being handled
上级
92ddf015
33940d71
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
21 deletion
+79
-21
source/libs/executor/src/timesliceoperator.c
source/libs/executor/src/timesliceoperator.c
+11
-3
tests/system-test/2-query/interp.py
tests/system-test/2-query/interp.py
+68
-18
未找到文件。
source/libs/executor/src/timesliceoperator.c
浏览文件 @
39a58c35
...
...
@@ -315,7 +315,7 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
if
(
pDst
->
info
.
type
==
TSDB_DATA_TYPE_FLOAT
)
{
float
v
=
0
;
if
(
!
IS_VAR_DATA_TYPE
(
pVar
->
nType
))
{
GET_TYPED_DATA
(
v
,
float
,
pVar
->
nType
,
&
pVar
->
i
);
GET_TYPED_DATA
(
v
,
float
,
pVar
->
nType
,
&
pVar
->
f
);
}
else
{
v
=
taosStr2Float
(
varDataVal
(
pVar
->
pz
),
NULL
);
}
...
...
@@ -323,7 +323,7 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
}
else
if
(
pDst
->
info
.
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
double
v
=
0
;
if
(
!
IS_VAR_DATA_TYPE
(
pVar
->
nType
))
{
GET_TYPED_DATA
(
v
,
double
,
pVar
->
nType
,
&
pVar
->
i
);
GET_TYPED_DATA
(
v
,
double
,
pVar
->
nType
,
&
pVar
->
d
);
}
else
{
v
=
taosStr2Double
(
varDataVal
(
pVar
->
pz
),
NULL
);
}
...
...
@@ -333,7 +333,15 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
if
(
!
IS_VAR_DATA_TYPE
(
pVar
->
nType
))
{
GET_TYPED_DATA
(
v
,
int64_t
,
pVar
->
nType
,
&
pVar
->
i
);
}
else
{
v
=
taosStr2int64
(
varDataVal
(
pVar
->
pz
));
v
=
taosStr2Int64
(
varDataVal
(
pVar
->
pz
),
NULL
,
10
);
}
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
pDst
->
info
.
type
))
{
uint64_t
v
=
0
;
if
(
!
IS_VAR_DATA_TYPE
(
pVar
->
nType
))
{
GET_TYPED_DATA
(
v
,
uint64_t
,
pVar
->
nType
,
&
pVar
->
u
);
}
else
{
v
=
taosStr2UInt64
(
varDataVal
(
pVar
->
pz
),
NULL
,
10
);
}
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
}
else
if
(
IS_BOOLEAN_TYPE
(
pDst
->
info
.
type
))
{
...
...
tests/system-test/2-query/interp.py
浏览文件 @
39a58c35
...
...
@@ -44,7 +44,7 @@ class TDTestCase:
tdSql
.
execute
(
f
'''create table if not exists
{
dbname
}
.
{
tbname
}
(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 double, c5 float, c6 bool, c7 varchar(10), c8 nchar(10))
(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 double, c5 float, c6 bool, c7 varchar(10), c8 nchar(10)
, c9 tinyint unsigned, c10 smallint unsigned, c11 int unsigned, c12 bigint unsigned
)
'''
)
...
...
@@ -52,9 +52,9 @@ class TDTestCase:
tdSql
.
execute
(
f
"use db"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
tbname
}
values ('2020-02-01 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar')"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
tbname
}
values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar')"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
tbname
}
values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
tbname
}
values ('2020-02-01 00:00:05', 5, 5, 5, 5, 5.0, 5.0, true, 'varchar', 'nchar'
, 5, 5, 5, 5
)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
tbname
}
values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar'
, 10, 10, 10, 10
)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
tbname
}
values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar'
, 15, 15, 15, 15
)"
)
tdLog
.
printNoPrefix
(
"==========step3:fill null"
)
...
...
@@ -129,21 +129,71 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"==========step4:fill value"
)
## {. . .}
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)"
)
col_list
=
{
'c0'
,
'c1'
,
'c2'
,
'c3'
,
'c9'
,
'c10'
,
'c11'
,
'c12'
}
for
col
in
col_list
:
tdSql
.
query
(
f
"select interp(
{
col
}
) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
5
)
tdSql
.
checkData
(
2
,
0
,
1
)
tdSql
.
checkData
(
3
,
0
,
1
)
tdSql
.
checkData
(
4
,
0
,
1
)
tdSql
.
checkData
(
5
,
0
,
1
)
tdSql
.
checkData
(
6
,
0
,
10
)
tdSql
.
checkData
(
7
,
0
,
1
)
tdSql
.
checkData
(
8
,
0
,
1
)
tdSql
.
checkData
(
9
,
0
,
1
)
tdSql
.
checkData
(
10
,
0
,
1
)
tdSql
.
checkData
(
11
,
0
,
15
)
tdSql
.
checkData
(
12
,
0
,
1
)
tdSql
.
query
(
f
"select interp(c4) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
5
)
tdSql
.
checkData
(
2
,
0
,
1
)
tdSql
.
checkData
(
3
,
0
,
1
)
tdSql
.
checkData
(
4
,
0
,
1
)
tdSql
.
checkData
(
5
,
0
,
1
)
tdSql
.
checkData
(
6
,
0
,
10
)
tdSql
.
checkData
(
7
,
0
,
1
)
tdSql
.
checkData
(
8
,
0
,
1
)
tdSql
.
checkData
(
9
,
0
,
1
)
tdSql
.
checkData
(
10
,
0
,
1
)
tdSql
.
checkData
(
11
,
0
,
15
)
tdSql
.
checkData
(
12
,
0
,
1
)
tdSql
.
checkData
(
0
,
0
,
1.0
)
tdSql
.
checkData
(
1
,
0
,
5.0
)
tdSql
.
checkData
(
2
,
0
,
1.0
)
tdSql
.
checkData
(
3
,
0
,
1.0
)
tdSql
.
checkData
(
4
,
0
,
1.0
)
tdSql
.
checkData
(
5
,
0
,
1.0
)
tdSql
.
checkData
(
6
,
0
,
10.0
)
tdSql
.
checkData
(
7
,
0
,
1.0
)
tdSql
.
checkData
(
8
,
0
,
1.0
)
tdSql
.
checkData
(
9
,
0
,
1.0
)
tdSql
.
checkData
(
10
,
0
,
1.0
)
tdSql
.
checkData
(
11
,
0
,
15.0
)
tdSql
.
checkData
(
12
,
0
,
1.0
)
tdSql
.
query
(
f
"select interp(c5) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
1.0
)
tdSql
.
checkData
(
1
,
0
,
5.0
)
tdSql
.
checkData
(
2
,
0
,
1.0
)
tdSql
.
checkData
(
3
,
0
,
1.0
)
tdSql
.
checkData
(
4
,
0
,
1.0
)
tdSql
.
checkData
(
5
,
0
,
1.0
)
tdSql
.
checkData
(
6
,
0
,
10.0
)
tdSql
.
checkData
(
7
,
0
,
1.0
)
tdSql
.
checkData
(
8
,
0
,
1.0
)
tdSql
.
checkData
(
9
,
0
,
1.0
)
tdSql
.
checkData
(
10
,
0
,
1.0
)
tdSql
.
checkData
(
11
,
0
,
15.0
)
tdSql
.
checkData
(
12
,
0
,
1.0
)
tdSql
.
query
(
f
"select interp(c6) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(value, 1)"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
True
)
tdSql
.
checkData
(
1
,
0
,
True
)
tdSql
.
checkData
(
2
,
0
,
True
)
tdSql
.
checkData
(
3
,
0
,
True
)
tdSql
.
checkData
(
4
,
0
,
True
)
tdSql
.
checkData
(
5
,
0
,
True
)
tdSql
.
checkData
(
6
,
0
,
True
)
tdSql
.
checkData
(
7
,
0
,
True
)
tdSql
.
checkData
(
8
,
0
,
True
)
tdSql
.
checkData
(
9
,
0
,
True
)
tdSql
.
checkData
(
10
,
0
,
True
)
tdSql
.
checkData
(
11
,
0
,
True
)
tdSql
.
checkData
(
12
,
0
,
True
)
## {} ...
tdSql
.
query
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-01 00:00:01', '2020-02-01 00:00:04') every(1s) fill(value, 1)"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录