Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2cf2260e
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看板
未验证
提交
2cf2260e
编写于
8月 31, 2021
作者:
H
Haojun Liao
提交者:
GitHub
8月 31, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7706 from taosdata/feature/query
[td-255] code refactor.
上级
50b3291a
261bfd00
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
68 deletion
+19
-68
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+19
-68
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
2cf2260e
...
@@ -6388,6 +6388,19 @@ static SSDataBlock* hashGroupbyAggregate(void* param, bool* newgroup) {
...
@@ -6388,6 +6388,19 @@ static SSDataBlock* hashGroupbyAggregate(void* param, bool* newgroup) {
return
pInfo
->
binfo
.
pRes
;
return
pInfo
->
binfo
.
pRes
;
}
}
static
void
doHandleRemainBlockForNewGroupImpl
(
SFillOperatorInfo
*
pInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
bool
*
newgroup
)
{
pInfo
->
totalInputRows
=
pInfo
->
existNewGroupBlock
->
info
.
rows
;
int64_t
ekey
=
Q_STATUS_EQUAL
(
pRuntimeEnv
->
status
,
QUERY_COMPLETED
)
?
pRuntimeEnv
->
pQueryAttr
->
window
.
ekey
:
pInfo
->
existNewGroupBlock
->
info
.
window
.
ekey
;
taosResetFillInfo
(
pInfo
->
pFillInfo
,
pInfo
->
pFillInfo
->
start
);
taosFillSetStartInfo
(
pInfo
->
pFillInfo
,
pInfo
->
existNewGroupBlock
->
info
.
rows
,
ekey
);
taosFillSetInputDataBlock
(
pInfo
->
pFillInfo
,
pInfo
->
existNewGroupBlock
);
doFillTimeIntervalGapsInResults
(
pInfo
->
pFillInfo
,
pInfo
->
pRes
,
pRuntimeEnv
->
resultInfo
.
capacity
,
pInfo
->
p
);
pInfo
->
existNewGroupBlock
=
NULL
;
*
newgroup
=
true
;
}
static
void
doHandleRemainBlockFromNewGroup
(
SFillOperatorInfo
*
pInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
bool
*
newgroup
)
{
static
void
doHandleRemainBlockFromNewGroup
(
SFillOperatorInfo
*
pInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
bool
*
newgroup
)
{
if
(
taosFillHasMoreResults
(
pInfo
->
pFillInfo
))
{
if
(
taosFillHasMoreResults
(
pInfo
->
pFillInfo
))
{
*
newgroup
=
false
;
*
newgroup
=
false
;
...
@@ -6399,16 +6412,7 @@ static void doHandleRemainBlockFromNewGroup(SFillOperatorInfo *pInfo, SQueryRunt
...
@@ -6399,16 +6412,7 @@ static void doHandleRemainBlockFromNewGroup(SFillOperatorInfo *pInfo, SQueryRunt
// handle the cached new group data block
// handle the cached new group data block
if
(
pInfo
->
existNewGroupBlock
)
{
if
(
pInfo
->
existNewGroupBlock
)
{
pInfo
->
totalInputRows
=
pInfo
->
existNewGroupBlock
->
info
.
rows
;
doHandleRemainBlockForNewGroupImpl
(
pInfo
,
pRuntimeEnv
,
newgroup
);
int64_t
ekey
=
Q_STATUS_EQUAL
(
pRuntimeEnv
->
status
,
QUERY_COMPLETED
)
?
pRuntimeEnv
->
pQueryAttr
->
window
.
ekey
:
pInfo
->
existNewGroupBlock
->
info
.
window
.
ekey
;
taosResetFillInfo
(
pInfo
->
pFillInfo
,
pInfo
->
pFillInfo
->
start
);
taosFillSetStartInfo
(
pInfo
->
pFillInfo
,
pInfo
->
existNewGroupBlock
->
info
.
rows
,
ekey
);
taosFillSetInputDataBlock
(
pInfo
->
pFillInfo
,
pInfo
->
existNewGroupBlock
);
doFillTimeIntervalGapsInResults
(
pInfo
->
pFillInfo
,
pInfo
->
pRes
,
pRuntimeEnv
->
resultInfo
.
capacity
,
pInfo
->
p
);
pInfo
->
existNewGroupBlock
=
NULL
;
*
newgroup
=
true
;
}
}
}
}
...
@@ -6427,26 +6431,6 @@ static SSDataBlock* doFill(void* param, bool* newgroup) {
...
@@ -6427,26 +6431,6 @@ static SSDataBlock* doFill(void* param, bool* newgroup) {
if
(
pInfo
->
pRes
->
info
.
rows
>
pRuntimeEnv
->
resultInfo
.
threshold
||
(
!
pInfo
->
multigroupResult
&&
pInfo
->
pRes
->
info
.
rows
>
0
))
{
if
(
pInfo
->
pRes
->
info
.
rows
>
pRuntimeEnv
->
resultInfo
.
threshold
||
(
!
pInfo
->
multigroupResult
&&
pInfo
->
pRes
->
info
.
rows
>
0
))
{
return
pInfo
->
pRes
;
return
pInfo
->
pRes
;
}
}
// if (taosFillHasMoreResults(pInfo->pFillInfo)) {
// *newgroup = false;
// doFillTimeIntervalGapsInResults(pInfo->pFillInfo, pInfo->pRes, (int32_t)pRuntimeEnv->resultInfo.capacity);
// return pInfo->pRes;
// }
//
// // handle the cached new group data block
// if (pInfo->existNewGroupBlock) {
// pInfo->totalInputRows = pInfo->existNewGroupBlock->info.rows;
// int64_t ekey = Q_STATUS_EQUAL(pRuntimeEnv->status, QUERY_COMPLETED)?pRuntimeEnv->pQueryAttr->window.ekey:pInfo->existNewGroupBlock->info.window.ekey;
// taosResetFillInfo(pInfo->pFillInfo, pInfo->pFillInfo->start);
//
// taosFillSetStartInfo(pInfo->pFillInfo, pInfo->existNewGroupBlock->info.rows, ekey);
// taosFillSetInputDataBlock(pInfo->pFillInfo, pInfo->existNewGroupBlock);
//
// doFillTimeIntervalGapsInResults(pInfo->pFillInfo, pInfo->pRes, pRuntimeEnv->resultInfo.capacity);
// pInfo->existNewGroupBlock = NULL;
// *newgroup = true;
// return (pInfo->pRes->info.rows > 0)? pInfo->pRes:NULL;
// }
while
(
1
)
{
while
(
1
)
{
publishOperatorProfEvent
(
pOperator
->
upstream
[
0
],
QUERY_PROF_BEFORE_OPERATOR_EXEC
);
publishOperatorProfEvent
(
pOperator
->
upstream
[
0
],
QUERY_PROF_BEFORE_OPERATOR_EXEC
);
...
@@ -6493,46 +6477,13 @@ static SSDataBlock* doFill(void* param, bool* newgroup) {
...
@@ -6493,46 +6477,13 @@ static SSDataBlock* doFill(void* param, bool* newgroup) {
if
(
pInfo
->
pRes
->
info
.
rows
>
pRuntimeEnv
->
resultInfo
.
threshold
||
pBlock
==
NULL
)
{
if
(
pInfo
->
pRes
->
info
.
rows
>
pRuntimeEnv
->
resultInfo
.
threshold
||
pBlock
==
NULL
)
{
return
pInfo
->
pRes
;
return
pInfo
->
pRes
;
}
}
// if (taosFillHasMoreResults(pInfo->pFillInfo)) {
// *newgroup = false;
// doFillTimeIntervalGapsInResults(pInfo->pFillInfo, pInfo->pRes, (int32_t)pRuntimeEnv->resultInfo.capacity);
// return pInfo->pRes;
// }
//
// // handle the cached new group data block
// if (pInfo->existNewGroupBlock) {
// pInfo->totalInputRows = pInfo->existNewGroupBlock->info.rows;
// int64_t ekey = Q_STATUS_EQUAL(pRuntimeEnv->status, QUERY_COMPLETED)?pRuntimeEnv->pQueryAttr->window.ekey:pInfo->existNewGroupBlock->info.window.ekey;
// taosResetFillInfo(pInfo->pFillInfo, pInfo->pFillInfo->start);
//
// taosFillSetStartInfo(pInfo->pFillInfo, pInfo->existNewGroupBlock->info.rows, ekey);
// taosFillSetInputDataBlock(pInfo->pFillInfo, pInfo->existNewGroupBlock);
//
// doFillTimeIntervalGapsInResults(pInfo->pFillInfo, pInfo->pRes, pRuntimeEnv->resultInfo.capacity);
// pInfo->existNewGroupBlock = NULL;
// *newgroup = true;
//
// if (pInfo->pRes->info.rows > pRuntimeEnv->resultInfo.threshold) {
// return pInfo->pRes;
// }
//
//// return (pInfo->pRes->info.rows > 0)? pInfo->pRes:NULL;
// }
}
else
if
(
pInfo
->
existNewGroupBlock
)
{
// try next group
}
else
if
(
pInfo
->
existNewGroupBlock
)
{
// try next group
pInfo
->
totalInputRows
=
pInfo
->
existNewGroupBlock
->
info
.
rows
;
assert
(
pBlock
!=
NULL
);
int64_t
ekey
=
pInfo
->
existNewGroupBlock
->
info
.
window
.
ekey
;
doHandleRemainBlockForNewGroupImpl
(
pInfo
,
pRuntimeEnv
,
newgroup
);
taosResetFillInfo
(
pInfo
->
pFillInfo
,
pInfo
->
pFillInfo
->
start
);
taosFillSetStartInfo
(
pInfo
->
pFillInfo
,
pInfo
->
existNewGroupBlock
->
info
.
rows
,
ekey
);
taosFillSetInputDataBlock
(
pInfo
->
pFillInfo
,
pInfo
->
existNewGroupBlock
);
doFillTimeIntervalGapsInResults
(
pInfo
->
pFillInfo
,
pInfo
->
pRes
,
pRuntimeEnv
->
resultInfo
.
capacity
,
pInfo
->
p
);
pInfo
->
existNewGroupBlock
=
NULL
;
*
newgroup
=
true
;
return
(
pInfo
->
pRes
->
info
.
rows
>
0
)
?
pInfo
->
pRes
:
NULL
;
if
(
pInfo
->
pRes
->
info
.
rows
>
pRuntimeEnv
->
resultInfo
.
threshold
)
{
return
pInfo
->
pRes
;
}
}
else
{
}
else
{
return
NULL
;
return
NULL
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录