Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
976b3663
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看板
提交
976b3663
编写于
9月 22, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): keep last key for interp query.
上级
6c6e20ff
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
5 deletion
+16
-5
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+9
-4
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+7
-1
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
976b3663
...
...
@@ -3329,7 +3329,7 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl
if
(
pCond
->
type
==
TIMEWINDOW_RANGE_EXTERNAL
)
{
// update the SQueryTableDataCond to create inner reader
int32_t
order
=
pCond
->
order
;
int32_t
order
=
pCond
->
order
;
if
(
order
==
TSDB_ORDER_ASC
)
{
pCond
->
twindows
.
ekey
=
window
.
skey
;
pCond
->
twindows
.
skey
=
INT64_MIN
;
...
...
@@ -3353,6 +3353,8 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl
pCond
->
twindows
.
skey
=
INT64_MIN
;
pCond
->
twindows
.
ekey
=
window
.
ekey
;
}
pCond
->
order
=
order
;
code
=
tsdbReaderCreate
(
pVnode
,
pCond
,
&
pReader
->
innerReader
[
1
],
1
,
idstr
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_err
;
...
...
@@ -3373,8 +3375,10 @@ int32_t tsdbReaderOpen(SVnode* pVnode, SQueryTableDataCond* pCond, SArray* pTabl
}
}
STsdbReader
*
p
=
pReader
->
innerReader
[
0
]
!=
NULL
?
pReader
->
innerReader
[
0
]
:
pReader
;
int32_t
numOfTables
=
taosArrayGetSize
(
pTableList
);
pReader
->
status
.
pTableMap
=
createDataBlockScanInfo
(
p
Reader
,
pTableList
->
pData
,
numOfTables
);
pReader
->
status
.
pTableMap
=
createDataBlockScanInfo
(
p
,
pTableList
->
pData
,
numOfTables
);
if
(
pReader
->
status
.
pTableMap
==
NULL
)
{
tsdbReaderClose
(
pReader
);
*
ppReader
=
NULL
;
...
...
@@ -3541,8 +3545,9 @@ bool tsdbNextDataBlock(STsdbReader* pReader) {
if
(
pReader
->
innerReader
[
0
]
!=
NULL
&&
pReader
->
step
==
0
)
{
bool
ret
=
doTsdbNextDataBlock
(
pReader
->
innerReader
[
0
]);
resetDataBlockScanInfo
(
pReader
->
innerReader
[
0
]
->
status
.
pTableMap
,
pReader
->
innerReader
[
0
]
->
window
.
ekey
);
pReader
->
step
=
EXTERNAL_ROWS_PREV
;
if
(
ret
)
{
pReader
->
step
=
EXTERNAL_ROWS_PREV
;
return
ret
;
}
}
...
...
@@ -3559,8 +3564,8 @@ bool tsdbNextDataBlock(STsdbReader* pReader) {
if
(
pReader
->
innerReader
[
1
]
!=
NULL
&&
pReader
->
step
==
EXTERNAL_ROWS_MAIN
)
{
resetDataBlockScanInfo
(
pReader
->
innerReader
[
1
]
->
status
.
pTableMap
,
pReader
->
window
.
ekey
);
bool
ret1
=
doTsdbNextDataBlock
(
pReader
->
innerReader
[
1
]);
pReader
->
step
=
EXTERNAL_ROWS_NEXT
;
if
(
ret1
)
{
pReader
->
step
=
EXTERNAL_ROWS_NEXT
;
return
ret1
;
}
}
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
976b3663
...
...
@@ -1994,7 +1994,7 @@ static void doKeepLinearInfo(STimeSliceOperatorInfo* pSliceInfo, const SSDataBlo
}
}
pSliceInfo
->
fillLastPoint
=
isLastRow
?
true
:
false
;
pSliceInfo
->
fillLastPoint
=
isLastRow
;
}
static
void
genInterpolationResult
(
STimeSliceOperatorInfo
*
pSliceInfo
,
SExprSupp
*
pExprSup
,
SSDataBlock
*
pResBlock
)
{
...
...
@@ -2342,6 +2342,9 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
break
;
}
}
}
else
{
// store ts value as start, and calculate interp value when processing next block
doKeepLinearInfo
(
pSliceInfo
,
pBlock
,
i
,
true
);
}
}
else
{
// non-linear interpolation
if
(
i
<
pBlock
->
info
.
rows
-
1
)
{
...
...
@@ -2420,6 +2423,9 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
break
;
}
}
}
else
{
// it is the last row of current block
// store ts value as start, and calculate interp value when processing next block
doKeepLinearInfo
(
pSliceInfo
,
pBlock
,
i
,
true
);
}
}
else
{
// non-linear interpolation
pSliceInfo
->
current
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录