Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b8bfbc90
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
提交
b8bfbc90
编写于
7月 06, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix bugs in sliding query
上级
ed458e10
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
17 deletion
+21
-17
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+21
-17
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
b8bfbc90
...
@@ -685,26 +685,24 @@ static void doBlockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SWindowStat
...
@@ -685,26 +685,24 @@ static void doBlockwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SWindowStat
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SQLFunctionCtx
*
pCtx
=
pRuntimeEnv
->
pCtx
;
SQLFunctionCtx
*
pCtx
=
pRuntimeEnv
->
pCtx
;
if
(
IS_MASTER_SCAN
(
pRuntimeEnv
)
||
pStatus
->
closed
)
{
for
(
int32_t
k
=
0
;
k
<
pQuery
->
numOfOutput
;
++
k
)
{
for
(
int32_t
k
=
0
;
k
<
pQuery
->
numOfOutput
;
++
k
)
{
int32_t
functionId
=
pQuery
->
pSelectExpr
[
k
].
base
.
functionId
;
int32_t
functionId
=
pQuery
->
pSelectExpr
[
k
].
base
.
functionId
;
pCtx
[
k
].
nStartQueryTimestamp
=
pWin
->
skey
;
pCtx
[
k
].
nStartQueryTimestamp
=
pWin
->
skey
;
pCtx
[
k
].
size
=
forwardStep
;
pCtx
[
k
].
size
=
forwardStep
;
pCtx
[
k
].
startOffset
=
(
QUERY_IS_ASC_QUERY
(
pQuery
))
?
offset
:
offset
-
(
forwardStep
-
1
);
pCtx
[
k
].
startOffset
=
(
QUERY_IS_ASC_QUERY
(
pQuery
))
?
offset
:
offset
-
(
forwardStep
-
1
);
if
((
aAggs
[
functionId
].
nStatus
&
TSDB_FUNCSTATE_SELECTIVITY
)
!=
0
)
{
if
((
aAggs
[
functionId
].
nStatus
&
TSDB_FUNCSTATE_SELECTIVITY
)
!=
0
)
{
pCtx
[
k
].
ptsList
=
&
tsBuf
[
offset
];
pCtx
[
k
].
ptsList
=
&
tsBuf
[
offset
];
}
}
// not a whole block involved in query processing, statistics data can not be used
// not a whole block involved in query processing, statistics data can not be used
if
(
forwardStep
!=
numOfTotal
)
{
if
(
forwardStep
!=
numOfTotal
)
{
pCtx
[
k
].
preAggVals
.
isSet
=
false
;
pCtx
[
k
].
preAggVals
.
isSet
=
false
;
}
}
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
}
}
}
}
}
}
}
...
@@ -1086,6 +1084,11 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv *pRuntimeEnv, int32_t offset) {
...
@@ -1086,6 +1084,11 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv *pRuntimeEnv, int32_t offset) {
static
bool
functionNeedToExecute
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
functionId
)
{
static
bool
functionNeedToExecute
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
functionId
)
{
SResultInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
SResultInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
// in case of timestamp column, always generated results.
if
(
functionId
==
TSDB_FUNC_TS
)
{
return
true
;
}
if
(
pResInfo
->
complete
||
functionId
==
TSDB_FUNC_TAG_DUMMY
||
functionId
==
TSDB_FUNC_TS_DUMMY
)
{
if
(
pResInfo
->
complete
||
functionId
==
TSDB_FUNC_TAG_DUMMY
||
functionId
==
TSDB_FUNC_TS_DUMMY
)
{
return
false
;
return
false
;
...
@@ -4716,6 +4719,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
...
@@ -4716,6 +4719,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
qDebug
(
"QInfo:%p reversed scan completed, elapsed time: %"
PRId64
"ms"
,
pQInfo
,
el
);
qDebug
(
"QInfo:%p reversed scan completed, elapsed time: %"
PRId64
"ms"
,
pQInfo
,
el
);
doRestoreContext
(
pQInfo
);
doRestoreContext
(
pQInfo
);
doCloseAllTimeWindowAfterScan
(
pQInfo
);
}
else
{
}
else
{
qDebug
(
"QInfo:%p no need to do reversed scan, query completed"
,
pQInfo
);
qDebug
(
"QInfo:%p no need to do reversed scan, query completed"
,
pQInfo
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录