Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e41a0002
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
e41a0002
编写于
8月 25, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
8月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16397 from taosdata/fix/TD-18617
fix(query): fix multiple interp used result number of rows incorrect
上级
66791778
167673e5
变更
27
显示空白变更内容
内联
并排
Showing
27 changed file
with
112 addition
and
53 deletion
+112
-53
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+14
-5
tests/script/tsim/parser/alter1.sim
tests/script/tsim/parser/alter1.sim
+1
-1
tests/script/tsim/parser/binary_escapeCharacter.sim
tests/script/tsim/parser/binary_escapeCharacter.sim
+1
-1
tests/script/tsim/parser/col_arithmetic_operation.sim
tests/script/tsim/parser/col_arithmetic_operation.sim
+1
-1
tests/script/tsim/parser/columnValue_unsign.sim
tests/script/tsim/parser/columnValue_unsign.sim
+1
-1
tests/script/tsim/parser/fill_stb.sim
tests/script/tsim/parser/fill_stb.sim
+1
-1
tests/script/tsim/parser/import_file.sim
tests/script/tsim/parser/import_file.sim
+1
-1
tests/script/tsim/parser/repeatAlter.sim
tests/script/tsim/parser/repeatAlter.sim
+1
-1
tests/script/tsim/parser/select_from_cache_disk.sim
tests/script/tsim/parser/select_from_cache_disk.sim
+1
-1
tests/script/tsim/parser/single_row_in_tb.sim
tests/script/tsim/parser/single_row_in_tb.sim
+1
-1
tests/script/tsim/parser/single_row_in_tb_query.sim
tests/script/tsim/parser/single_row_in_tb_query.sim
+1
-1
tests/script/tsim/query/complex_group.sim
tests/script/tsim/query/complex_group.sim
+1
-1
tests/script/tsim/query/complex_having.sim
tests/script/tsim/query/complex_having.sim
+1
-1
tests/script/tsim/query/complex_limit.sim
tests/script/tsim/query/complex_limit.sim
+1
-1
tests/script/tsim/query/complex_select.sim
tests/script/tsim/query/complex_select.sim
+1
-1
tests/script/tsim/query/complex_where.sim
tests/script/tsim/query/complex_where.sim
+1
-1
tests/script/tsim/query/crash_sql.sim
tests/script/tsim/query/crash_sql.sim
+1
-1
tests/script/tsim/query/diff.sim
tests/script/tsim/query/diff.sim
+9
-9
tests/script/tsim/query/explain.sim
tests/script/tsim/query/explain.sim
+8
-8
tests/script/tsim/query/interval.sim
tests/script/tsim/query/interval.sim
+1
-1
tests/script/tsim/query/scalarFunction.sim
tests/script/tsim/query/scalarFunction.sim
+3
-3
tests/script/tsim/query/scalarNull.sim
tests/script/tsim/query/scalarNull.sim
+1
-1
tests/script/tsim/query/session.sim
tests/script/tsim/query/session.sim
+6
-6
tests/script/tsim/query/stddev.sim
tests/script/tsim/query/stddev.sim
+1
-1
tests/script/tsim/query/time_process.sim
tests/script/tsim/query/time_process.sim
+1
-1
tests/script/tsim/query/udf.sim
tests/script/tsim/query/udf.sim
+1
-1
tests/system-test/2-query/interp.py
tests/system-test/2-query/interp.py
+51
-1
未找到文件。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
e41a0002
...
...
@@ -2146,6 +2146,7 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
// todo set the correct primary timestamp column
// output the result
bool
hasInterp
=
true
;
for
(
int32_t
j
=
0
;
j
<
pExprSup
->
numOfExprs
;
++
j
)
{
SExprInfo
*
pExprInfo
=
&
pExprSup
->
pExprInfo
[
j
];
int32_t
srcSlot
=
pExprInfo
->
base
.
pParam
[
0
].
pCol
->
slotId
;
...
...
@@ -2157,7 +2158,6 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
switch
(
pSliceInfo
->
fillType
)
{
case
TSDB_FILL_NULL
:
{
colDataAppendNULL
(
pDst
,
rows
);
pResBlock
->
info
.
rows
+=
1
;
break
;
}
...
...
@@ -2177,7 +2177,6 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
GET_TYPED_DATA
(
v
,
int64_t
,
pVar
->
nType
,
&
pVar
->
i
);
colDataAppend
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
}
pResBlock
->
info
.
rows
+=
1
;
break
;
}
...
...
@@ -2191,6 +2190,7 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
// before interp range, do not fill
if
(
start
.
key
==
INT64_MIN
||
end
.
key
==
INT64_MAX
)
{
hasInterp
=
false
;
break
;
}
...
...
@@ -2202,28 +2202,27 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
}
taosMemoryFree
(
current
.
val
);
pResBlock
->
info
.
rows
+=
1
;
break
;
}
case
TSDB_FILL_PREV
:
{
if
(
!
pSliceInfo
->
isPrevRowSet
)
{
hasInterp
=
false
;
break
;
}
SGroupKeys
*
pkey
=
taosArrayGet
(
pSliceInfo
->
pPrevRow
,
srcSlot
);
colDataAppend
(
pDst
,
rows
,
pkey
->
pData
,
false
);
pResBlock
->
info
.
rows
+=
1
;
break
;
}
case
TSDB_FILL_NEXT
:
{
if
(
!
pSliceInfo
->
isNextRowSet
)
{
hasInterp
=
false
;
break
;
}
SGroupKeys
*
pkey
=
taosArrayGet
(
pSliceInfo
->
pNextRow
,
srcSlot
);
colDataAppend
(
pDst
,
rows
,
pkey
->
pData
,
false
);
pResBlock
->
info
.
rows
+=
1
;
break
;
}
...
...
@@ -2232,6 +2231,11 @@ static void genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
break
;
}
}
if
(
hasInterp
)
{
pResBlock
->
info
.
rows
+=
1
;
}
}
static
int32_t
initPrevRowsKeeper
(
STimeSliceOperatorInfo
*
pInfo
,
SSDataBlock
*
pBlock
)
{
...
...
@@ -2412,6 +2416,11 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
SColumnInfoData
*
pSrc
=
taosArrayGet
(
pBlock
->
pDataBlock
,
srcSlot
);
SColumnInfoData
*
pDst
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
dstSlot
);
if
(
colDataIsNull_s
(
pSrc
,
i
))
{
colDataAppendNULL
(
pDst
,
pResBlock
->
info
.
rows
);
continue
;
}
char
*
v
=
colDataGetData
(
pSrc
,
i
);
colDataAppend
(
pDst
,
pResBlock
->
info
.
rows
,
v
,
false
);
}
...
...
tests/script/tsim/parser/alter1.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/binary_escapeCharacter.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/col_arithmetic_operation.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/columnValue_unsign.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/fill_stb.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/import_file.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/repeatAlter.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/select_from_cache_disk.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/single_row_in_tb.sim
浏览文件 @
e41a0002
tests/script/tsim/parser/single_row_in_tb_query.sim
浏览文件 @
e41a0002
tests/script/tsim/query/complex_group.sim
浏览文件 @
e41a0002
tests/script/tsim/query/complex_having.sim
浏览文件 @
e41a0002
tests/script/tsim/query/complex_limit.sim
浏览文件 @
e41a0002
tests/script/tsim/query/complex_select.sim
浏览文件 @
e41a0002
tests/script/tsim/query/complex_where.sim
浏览文件 @
e41a0002
tests/script/tsim/query/crash_sql.sim
浏览文件 @
e41a0002
tests/script/tsim/query/diff.sim
浏览文件 @
e41a0002
tests/script/tsim/query/explain.sim
浏览文件 @
e41a0002
tests/script/tsim/query/interval.sim
浏览文件 @
e41a0002
tests/script/tsim/query/scalarFunction.sim
浏览文件 @
e41a0002
tests/script/tsim/query/scalarNull.sim
浏览文件 @
e41a0002
tests/script/tsim/query/session.sim
浏览文件 @
e41a0002
tests/script/tsim/query/stddev.sim
浏览文件 @
e41a0002
tests/script/tsim/query/time_process.sim
浏览文件 @
e41a0002
tests/script/tsim/query/udf.sim
浏览文件 @
e41a0002
tests/system-test/2-query/interp.py
浏览文件 @
e41a0002
...
...
@@ -551,7 +551,57 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
15
)
tdSql
.
checkData
(
1
,
0
,
15
)
tdLog
.
printNoPrefix
(
"==========step9:test error cases"
)
tdLog
.
printNoPrefix
(
"==========step9:test multi-interp cases"
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(null)"
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkCols
(
4
)
for
i
in
range
(
tdSql
.
queryCols
):
tdSql
.
checkData
(
0
,
i
,
None
)
tdSql
.
checkData
(
1
,
i
,
None
)
tdSql
.
checkData
(
2
,
i
,
15
)
tdSql
.
checkData
(
3
,
i
,
None
)
tdSql
.
checkData
(
4
,
i
,
None
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(value, 1)"
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkCols
(
4
)
for
i
in
range
(
tdSql
.
queryCols
):
tdSql
.
checkData
(
0
,
i
,
1
)
tdSql
.
checkData
(
1
,
i
,
1
)
tdSql
.
checkData
(
2
,
i
,
15
)
tdSql
.
checkData
(
3
,
i
,
1
)
tdSql
.
checkData
(
4
,
i
,
1
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(prev)"
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkCols
(
4
)
for
i
in
range
(
tdSql
.
queryCols
):
tdSql
.
checkData
(
0
,
i
,
5
)
tdSql
.
checkData
(
1
,
i
,
5
)
tdSql
.
checkData
(
2
,
i
,
15
)
tdSql
.
checkData
(
3
,
i
,
15
)
tdSql
.
checkData
(
4
,
i
,
15
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(next)"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkCols
(
4
)
for
i
in
range
(
tdSql
.
queryCols
):
tdSql
.
checkData
(
0
,
i
,
15
)
tdSql
.
checkData
(
1
,
i
,
15
)
tdSql
.
checkData
(
2
,
i
,
15
)
tdSql
.
query
(
f
"select interp(c0),interp(c1),interp(c2),interp(c3) from
{
dbname
}
.
{
tbname
}
range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(linear)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkCols
(
4
)
for
i
in
range
(
tdSql
.
queryCols
):
tdSql
.
checkData
(
0
,
i
,
15
)
tdLog
.
printNoPrefix
(
"==========step10:test error cases"
)
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
"
)
tdSql
.
error
(
f
"select interp(c0) from
{
dbname
}
.
{
tbname
}
range('2020-02-10 00:00:05', '2020-02-15 00:00:05')"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录