Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bc49ed2e
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bc49ed2e
编写于
11月 02, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs and add test cases
上级
ba5d069a
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
3826 addition
and
547 deletion
+3826
-547
src/client/src/tscGlobalmerge.c
src/client/src/tscGlobalmerge.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+9
-5
tests/script/general/parser/interp_full.sim
tests/script/general/parser/interp_full.sim
+12
-12
tests/script/general/parser/interp_full_test.sim
tests/script/general/parser/interp_full_test.sim
+0
-528
tests/script/general/parser/interp_full_test1.sim
tests/script/general/parser/interp_full_test1.sim
+2237
-0
tests/script/general/parser/interp_full_test2.sim
tests/script/general/parser/interp_full_test2.sim
+1566
-0
未找到文件。
src/client/src/tscGlobalmerge.c
浏览文件 @
bc49ed2e
...
...
@@ -595,7 +595,7 @@ static void doMergeResultImpl(SMultiwayMergeInfo* pInfo, SQLFunctionCtx *pCtx, i
for
(
int32_t
j
=
0
;
j
<
numOfExpr
;
++
j
)
{
int32_t
functionId
=
pCtx
[
j
].
functionId
;
if
(
functionId
==
TSDB_FUNC_T
AG_DUMMY
||
functionId
==
TSDB_FUNC_T
S_DUMMY
)
{
if
(
functionId
==
TSDB_FUNC_TS_DUMMY
)
{
continue
;
}
...
...
src/client/src/tscUtil.c
浏览文件 @
bc49ed2e
...
...
@@ -367,7 +367,7 @@ bool tscIsPointInterpQuery(SQueryInfo* pQueryInfo) {
assert
(
pExpr
!=
NULL
);
int32_t
functionId
=
pExpr
->
base
.
functionId
;
if
(
functionId
==
TSDB_FUNC_TAG
||
functionId
==
TSDB_FUNC_TS
||
functionId
==
TSDB_FUNC_TS_DUMMY
)
{
if
(
functionId
==
TSDB_FUNC_TAG
||
functionId
==
TSDB_FUNC_T
AG_DUMMY
||
functionId
==
TSDB_FUNC_T
S
||
functionId
==
TSDB_FUNC_TS_DUMMY
)
{
continue
;
}
...
...
src/query/src/qExecutor.c
浏览文件 @
bc49ed2e
...
...
@@ -1257,7 +1257,7 @@ void doTimeWindowInterpolation(SOperatorInfo* pOperator, SOptrBasicInfo* pInfo,
int16_t
index
=
pColIndex
->
colIndex
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pDataBlock
,
index
);
assert
(
pColInfo
->
info
.
colId
==
pColIndex
->
colId
);
assert
(
pColInfo
->
info
.
colId
<=
TSDB_RES_COL_ID
||
(
pColInfo
->
info
.
colId
>=
0
&&
pColInfo
->
info
.
colId
==
pColIndex
->
colId
)
);
double
v1
=
0
,
v2
=
0
,
v
=
0
;
if
(
functionId
==
TSDB_FUNC_INTERP
)
{
...
...
@@ -5924,7 +5924,9 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
SQLFunctionCtx
*
pCtx
=
NULL
;
for
(
int32_t
i
=
1
;
i
<
pOperatorInfo
->
numOfOutput
;
++
i
)
{
assert
(
pEveryInfo
->
binfo
.
pCtx
[
i
].
functionId
==
TSDB_FUNC_INTERP
||
pEveryInfo
->
binfo
.
pCtx
[
i
].
functionId
==
TSDB_FUNC_TS_DUMMY
);
assert
(
pEveryInfo
->
binfo
.
pCtx
[
i
].
functionId
==
TSDB_FUNC_INTERP
||
pEveryInfo
->
binfo
.
pCtx
[
i
].
functionId
==
TSDB_FUNC_TS_DUMMY
||
pEveryInfo
->
binfo
.
pCtx
[
i
].
functionId
==
TSDB_FUNC_TAG_DUMMY
);
if
(
pEveryInfo
->
binfo
.
pCtx
[
i
].
functionId
==
TSDB_FUNC_INTERP
)
{
pCtx
=
&
pEveryInfo
->
binfo
.
pCtx
[
i
];
...
...
@@ -5971,6 +5973,10 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
}
if
(
tsCols
==
NULL
&&
pCtx
->
startTs
>
pEveryInfo
->
tableEndKey
&&
ascQuery
)
{
if
(
pQueryAttr
->
range
.
ekey
==
INT64_MIN
)
{
goto
group_finished_exit
;
}
if
(
pQueryAttr
->
fillType
==
TSDB_FILL_NONE
||
pQueryAttr
->
fillType
==
TSDB_FILL_LINEAR
||
pQueryAttr
->
fillType
==
TSDB_FILL_NEXT
)
{
goto
group_finished_exit
;
}
...
...
@@ -5978,7 +5984,7 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
if
(
pQueryAttr
->
fillType
==
TSDB_FILL_PREV
)
{
TSKEY
lastTs
=
*
(
TSKEY
*
)
pRuntimeEnv
->
prevRow
[
0
];
if
(
lastTs
!=
INT64_MIN
)
{
doTimeWindowInterpolation
(
pOperatorInfo
,
pOperatorInfo
->
info
,
p
Block
->
pDataBlock
,
lastTs
,
-
1
,
INT64_MIN
,
0
,
0
,
RESULT_ROW_START_INTERP
);
doTimeWindowInterpolation
(
pOperatorInfo
,
pOperatorInfo
->
info
,
p
EveryInfo
->
binfo
.
pRes
->
pDataBlock
,
lastTs
,
-
1
,
INT64_MIN
,
0
,
0
,
RESULT_ROW_START_INTERP
);
}
else
{
goto
group_finished_exit
;
}
...
...
@@ -6125,8 +6131,6 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
return
pInfo
->
pRes
;
}
assert
(
pEveryInfo
->
groupDone
);
if
(
pRes
->
info
.
rows
>
0
)
{
qDebug
(
"2"
);
copyTsColoum
(
pRes
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
...
...
tests/script/general/parser/interp_full.sim
浏览文件 @
bc49ed2e
...
...
@@ -134,15 +134,15 @@ sql insert into tb4_0 values ('2021-10-20 10:04:55',55,55.0,55,55,55,55.0,false,
run general/parser/interp_full_test.sim
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 500
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
run general/parser/interp_full_test.sim
system sh/exec.sh -n dnode1 -s stop -x SIGINT
run general/parser/interp_full_test
1
.sim
run general/parser/interp_full_test2.sim
#
print ================== restart server to commit data into disk
#
system sh/exec.sh -n dnode1 -s stop -x SIGINT
#
sleep 500
#
system sh/exec.sh -n dnode1 -s start
#
print ================== server restart completed
#
#
run general/parser/interp_full_test.sim
#
#
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/general/parser/interp_full_test.sim
已删除
100644 → 0
浏览文件 @
ba5d069a
sleep 100
sql connect
sql_error SELECT INTERP(c7) FROM tb1;
sql_error SELECT INTERP(c8) FROM tb1;
sql_error SELECT INTERP(c9) FROM tb1;
sql_error SELECT INTERP(c1,c8) FROM tb1;
sql_error SELECT INTERP(*) FROM tb1;
sql_error SELECT INTERP(c1),INTERP(c8) FROM tb1;
sql_error SELECT INTERP(c1),avg(c1) FROM tb1;
sql_error SELECT INTERP(c1),c1 FROM tb1;
sql_error SELECT INTERP(c1),top(c1,3) FROM tb1;
sql_error SELECT INTERP(c1),first(c1) FROM tb1;
sql_error SELECT INTERP(c1),count(c1) FROM tb1;
sql_error SELECT INTERP(c1),ceil(c1) FROM tb1;
sql_error SELECT c1,c2,interp(c1) FROM tb1;
sql_error SELECT INTERP(c1) FROM stb1;
sql_error SELECT interp(c1) FROM stb1 group by t1;
sql_error SELECT interp(c1) FROM stb1 group by tbname,t1;
sql_error SELECT interp(c1) FROM stb1 group by tbname,ts;
sql_error SELECT interp(c1) FROM stb1 group by tbname,c1;
sql_error SELECT INTERP(c1) FROM tb1 interval(1s);
sql_error SELECT avg(c1) FROM tb1 every(1s);
sql_error SELECT avg(c1) FROM tb1 range(0,1);
sql_error SELECT INTERP(c1) FROM tb1 STATE_WINDOW(c1);
sql_error SELECT INTERP(c1) FROM tb1 SESSION(ts,100s);
sql SELECT INTERP(c1) FROM tb1;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
sql SELECT ts,INTERP(c1) FROM tb1;
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data02 != 0 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 where ts > '2021-10-20 10:00:03'
if $rows != 1 then
return -1
endi
if $data00 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data01 != 6 then
return -1
endi
sql SELECT INTERP(c1) FROM tb1 every(1s);
if $rows != 7 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data20 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
sql SELECT INTERP(c1,c2,c3,c4,c6,c5) FROM tb1 every(1s);
if $rows != 7 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0.00000 then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data04 != 0 then
return -1
endi
if $data05 != 0.000000000 then
return -1
endi
if $data06 != 0 then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != 1.00000 then
return -1
endi
if $data13 != 1 then
return -1
endi
if $data14 != 1 then
return -1
endi
if $data15 != 1.000000000 then
return -1
endi
if $data16 != 1 then
return -1
endi
if $data20 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data22 != 3.00000 then
return -1
endi
if $data23 != 3 then
return -1
endi
if $data24 != 3 then
return -1
endi
if $data25 != 3.000000000 then
return -1
endi
if $data26 != 3 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != 6.00000 then
return -1
endi
if $data33 != 6 then
return -1
endi
if $data34 != 6 then
return -1
endi
if $data35 != 6.000000000 then
return -1
endi
if $data36 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data42 != 10.00000 then
return -1
endi
if $data43 != 10 then
return -1
endi
if $data44 != 10 then
return -1
endi
if $data45 != 10.000000000 then
return -1
endi
if $data46 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data52 != 15.00000 then
return -1
endi
if $data53 != 15 then
return -1
endi
if $data54 != 15 then
return -1
endi
if $data55 != 15.000000000 then
return -1
endi
if $data56 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
if $data62 != 21.00000 then
return -1
endi
if $data63 != 21 then
return -1
endi
if $data64 != 21 then
return -1
endi
if $data65 != 21.000000000 then
return -1
endi
if $data66 != 21 then
return -1
endi
sql SELECT INTERP(c1),interp(c2),interp(c3) FROM tb1 every(1s);
if $rows != 7 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != 0.00000 then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != 1.00000 then
return -1
endi
if $data13 != 1 then
return -1
endi
if $data20 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data22 != 3.00000 then
return -1
endi
if $data23 != 3 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != 6.00000 then
return -1
endi
if $data33 != 6 then
return -1
endi
if $data40 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data42 != 10.00000 then
return -1
endi
if $data43 != 10 then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data52 != 15.00000 then
return -1
endi
if $data53 != 15 then
return -1
endi
if $data60 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
if $data62 != 21.00000 then
return -1
endi
if $data63 != 21 then
return -1
endi
sql SELECT INTERP(c1),ts FROM tb1 every(1s);
if $rows != 7 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data20 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data22 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data40 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data42 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data52 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data60 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
if $data62 != @21-10-20 10:00:21.000@ then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname;
if $rows != 21 then
return -1
endi
if $data00 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data02 != tb1 then
return -1
endi
if $data10 != @21-10-20 10:00:01.000@ then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data12 != tb1 then
return -1
endi
if $data20 != @21-10-20 10:00:03.000@ then
return -1
endi
if $data21 != 3 then
return -1
endi
if $data22 != tb1 then
return -1
endi
if $data30 != @21-10-20 10:00:06.000@ then
return -1
endi
if $data31 != 6 then
return -1
endi
if $data32 != tb1 then
return -1
endi
if $data40 != @21-10-20 10:00:10.000@ then
return -1
endi
if $data41 != 10 then
return -1
endi
if $data42 != tb1 then
return -1
endi
if $data50 != @21-10-20 10:00:15.000@ then
return -1
endi
if $data51 != 15 then
return -1
endi
if $data52 != tb1 then
return -1
endi
if $data60 != @21-10-20 10:00:21.000@ then
return -1
endi
if $data61 != 21 then
return -1
endi
if $data62 != tb1 then
return -1
endi
if $data70 != @21-10-20 10:00:00.000@ then
return -1
endi
if $data71 != 0 then
return -1
endi
if $data72 != tb2 then
return -1
endi
if $data80 != @21-10-20 10:00:02.000@ then
return -1
endi
if $data81 != 2 then
return -1
endi
if $data82 != tb2 then
return -1
endi
if $data90 != @21-10-20 10:00:04.000@ then
return -1
endi
if $data91 != 4 then
return -1
endi
if $data92 != tb2 then
return -1
endi
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname limit 10;
sql SELECT INTERP(c1) FROM stb1 every(1s) group by tbname limit 10 offset 10;
sql SELECT INTERP(c1),t1,interp(c2),t2,interp(c3) FROM stb1 every(1s) group by tbname;
sql SELECT tbname,INTERP(c1),t1,interp(c2),t2,interp(c3) FROM stb1 every(1s) group by tbname;
SELECT INTERP(c1) FROM stb1 range('2021-10-20 10:00:00.000','2021-10-20 10:00:40.000') every(1s) fill(linear) group by tbname;
tests/script/general/parser/interp_full_test1.sim
0 → 100644
浏览文件 @
bc49ed2e
此差异已折叠。
点击以展开。
tests/script/general/parser/interp_full_test2.sim
0 → 100644
浏览文件 @
bc49ed2e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录