Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
70fffcb6
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看板
提交
70fffcb6
编写于
9月 01, 2021
作者:
W
wpan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix interval query issue
上级
bab8850a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
14 deletion
+26
-14
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+7
-7
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+19
-7
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
70fffcb6
...
...
@@ -4099,7 +4099,7 @@ void setParamForStableStddevByColData(SQueryRuntimeEnv* pRuntimeEnv, SQLFunction
* merged during merge stage. In this case, we need the pTableQueryInfo->lastResRows to decide if there
* is a previous result generated or not.
*/
void
setIntervalQueryRange
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
TSKEY
key
)
{
void
setIntervalQueryRange
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
STimeWindow
*
winx
,
int32_t
tid
)
{
SQueryAttr
*
pQueryAttr
=
pRuntimeEnv
->
pQueryAttr
;
STableQueryInfo
*
pTableQueryInfo
=
pRuntimeEnv
->
current
;
SResultRowInfo
*
pResultRowInfo
=
&
pTableQueryInfo
->
resInfo
;
...
...
@@ -4108,7 +4108,9 @@ void setIntervalQueryRange(SQueryRuntimeEnv *pRuntimeEnv, TSKEY key) {
return
;
}
qDebug
(
"0x%"
PRIx64
" update query window, %"
PRId64
" - %"
PRId64
", old:%"
PRId64
" - %"
PRId64
,
GET_QID
(
pRuntimeEnv
),
key
,
pTableQueryInfo
->
win
.
ekey
,
TSKEY
key
=
QUERY_IS_ASC_QUERY
(
pQueryAttr
)
?
winx
->
skey
:
winx
->
ekey
;
qDebug
(
"0x%"
PRIx64
" update query window, tid:%d, %"
PRId64
" - %"
PRId64
", old:%"
PRId64
" - %"
PRId64
,
GET_QID
(
pRuntimeEnv
),
tid
,
key
,
pTableQueryInfo
->
win
.
ekey
,
pTableQueryInfo
->
win
.
skey
,
pTableQueryInfo
->
win
.
ekey
);
pTableQueryInfo
->
win
.
skey
=
key
;
...
...
@@ -6035,7 +6037,7 @@ static SSDataBlock* doSTableIntervalAgg(void* param, bool* newgroup) {
setTagValue
(
pOperator
,
pTableQueryInfo
->
pTable
,
pIntervalInfo
->
pCtx
,
pOperator
->
numOfOutput
);
setInputDataBlock
(
pOperator
,
pIntervalInfo
->
pCtx
,
pBlock
,
pQueryAttr
->
order
.
order
);
setIntervalQueryRange
(
pRuntimeEnv
,
pBlock
->
info
.
window
.
skey
);
setIntervalQueryRange
(
pRuntimeEnv
,
&
pBlock
->
info
.
window
,
pBlock
->
info
.
tid
);
hashIntervalAgg
(
pOperator
,
&
pTableQueryInfo
->
resInfo
,
pBlock
,
pTableQueryInfo
->
groupIndex
);
}
...
...
@@ -6090,7 +6092,8 @@ static SSDataBlock* doAllSTableIntervalAgg(void* param, bool* newgroup) {
setTagValue
(
pOperator
,
pTableQueryInfo
->
pTable
,
pIntervalInfo
->
pCtx
,
pOperator
->
numOfOutput
);
setInputDataBlock
(
pOperator
,
pIntervalInfo
->
pCtx
,
pBlock
,
pQueryAttr
->
order
.
order
);
setIntervalQueryRange
(
pRuntimeEnv
,
pBlock
->
info
.
window
.
skey
);
setIntervalQueryRange
(
pRuntimeEnv
,
&
pBlock
->
info
.
window
,
pBlock
->
info
.
tid
);
hashAllIntervalAgg
(
pOperator
,
&
pTableQueryInfo
->
resInfo
,
pBlock
,
pTableQueryInfo
->
groupIndex
);
}
...
...
@@ -6108,9 +6111,6 @@ static SSDataBlock* doAllSTableIntervalAgg(void* param, bool* newgroup) {
return
pIntervalInfo
->
pRes
;
}
static
void
doStateWindowAggImpl
(
SOperatorInfo
*
pOperator
,
SStateWindowOperatorInfo
*
pInfo
,
SSDataBlock
*
pSDataBlock
)
{
SQueryRuntimeEnv
*
pRuntimeEnv
=
pOperator
->
pRuntimeEnv
;
STableQueryInfo
*
item
=
pRuntimeEnv
->
current
;
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
70fffcb6
...
...
@@ -859,13 +859,25 @@ static TSKEY extractFirstTraverseKey(STableCheckInfo* pCheckInfo, int32_t order,
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_BOTH
;
}
return
r1
;
}
else
if
(
r1
<
r2
&&
ASCENDING_TRAVERSE
(
order
))
{
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_MEM
;
return
r1
;
}
else
{
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_IMEM
;
return
r2
;
}
else
{
if
(
ASCENDING_TRAVERSE
(
order
))
{
if
(
r1
<
r2
)
{
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_MEM
;
return
r1
;
}
else
{
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_IMEM
;
return
r2
;
}
}
else
{
if
(
r1
<
r2
)
{
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_IMEM
;
return
r2
;
}
else
{
pCheckInfo
->
chosen
=
CHECKINFO_CHOSEN_MEM
;
return
r1
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录