Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
TDengine
提交
b0cabda1
T
TDengine
项目概览
Tonvia
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b0cabda1
编写于
2月 19, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-2895] refactor
上级
232a4415
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
553 addition
and
85 deletion
+553
-85
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+1
-0
src/query/inc/qUtil.h
src/query/inc/qUtil.h
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+543
-75
src/query/src/qUtil.c
src/query/src/qUtil.c
+8
-9
未找到文件。
src/query/inc/qExecutor.h
浏览文件 @
b0cabda1
...
...
@@ -411,6 +411,7 @@ typedef struct SHashGroupbyOperatorInfo {
SQLFunctionCtx
*
pCtx
;
SResultRowInfo
resultRowInfo
;
SSDataBlock
*
pRes
;
int32_t
colIndex
;
}
SHashGroupbyOperatorInfo
;
void
freeParam
(
SQueryParam
*
param
);
...
...
src/query/inc/qUtil.h
浏览文件 @
b0cabda1
...
...
@@ -91,6 +91,6 @@ bool hasRemainData(SGroupResInfo* pGroupResInfo);
bool
incNextGroup
(
SGroupResInfo
*
pGroupResInfo
);
int32_t
getNumOfTotalRes
(
SGroupResInfo
*
pGroupResInfo
);
int32_t
mergeIntoGroupResult
(
SGroupResInfo
*
pGroupResInfo
,
SQ
Info
*
pQInfo
);
int32_t
mergeIntoGroupResult
(
SGroupResInfo
*
pGroupResInfo
,
SQ
ueryRuntimeEnv
*
pRuntimeEnv
);
#endif // TDENGINE_QUERYUTIL_H
src/query/src/qExecutor.c
浏览文件 @
b0cabda1
此差异已折叠。
点击以展开。
src/query/src/qUtil.c
浏览文件 @
b0cabda1
...
...
@@ -438,7 +438,7 @@ static int32_t tableResultComparFn(const void *pLeft, const void *pRight, void *
}
}
static
int32_t
mergeIntoGroupResultImpl
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
SArray
*
pTableList
,
void
*
qinfo
)
{
static
int32_t
mergeIntoGroupResultImpl
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
SArray
*
pTableList
)
{
bool
ascQuery
=
QUERY_IS_ASC_QUERY
(
pRuntimeEnv
->
pQuery
);
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -456,7 +456,7 @@ static int32_t mergeIntoGroupResultImpl(SQueryRuntimeEnv *pRuntimeEnv, SGroupRes
pTableQueryInfoList
=
malloc
(
POINTER_BYTES
*
size
);
if
(
pTableQueryInfoList
==
NULL
||
posList
==
NULL
||
pGroupResInfo
->
pRows
==
NULL
||
pGroupResInfo
->
pRows
==
NULL
)
{
qError
(
"QInfo:%p failed alloc memory"
,
qinfo
);
qError
(
"QInfo:%p failed alloc memory"
,
pRuntimeEnv
->
qinfo
);
code
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
goto
_end
;
}
...
...
@@ -528,7 +528,7 @@ static int32_t mergeIntoGroupResultImpl(SQueryRuntimeEnv *pRuntimeEnv, SGroupRes
int64_t
endt
=
taosGetTimestampMs
();
qDebug
(
"QInfo:%p result merge completed for group:%d, elapsed time:%"
PRId64
" ms"
,
qinfo
,
qDebug
(
"QInfo:%p result merge completed for group:%d, elapsed time:%"
PRId64
" ms"
,
pRuntimeEnv
->
qinfo
,
pGroupResInfo
->
currentGroup
,
endt
-
startt
);
_end:
...
...
@@ -539,14 +539,13 @@ static int32_t mergeIntoGroupResultImpl(SQueryRuntimeEnv *pRuntimeEnv, SGroupRes
return
code
;
}
int32_t
mergeIntoGroupResult
(
SGroupResInfo
*
pGroupResInfo
,
SQ
Info
*
pQInfo
)
{
int32_t
mergeIntoGroupResult
(
SGroupResInfo
*
pGroupResInfo
,
SQ
ueryRuntimeEnv
*
pRuntimeEnv
)
{
int64_t
st
=
taosGetTimestampUs
();
SQueryRuntimeEnv
*
pRuntimeEnv
=
&
pQInfo
->
runtimeEnv
;
while
(
pGroupResInfo
->
currentGroup
<
pGroupResInfo
->
totalGroup
)
{
SArray
*
group
=
GET_TABLEGROUP
(
pRuntimeEnv
,
pGroupResInfo
->
currentGroup
);
int32_t
ret
=
mergeIntoGroupResultImpl
(
pRuntimeEnv
,
pGroupResInfo
,
group
,
pQInfo
);
int32_t
ret
=
mergeIntoGroupResultImpl
(
pRuntimeEnv
,
pGroupResInfo
,
group
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
}
...
...
@@ -556,7 +555,7 @@ int32_t mergeIntoGroupResult(SGroupResInfo* pGroupResInfo, SQInfo *pQInfo) {
break
;
}
qDebug
(
"QInfo:%p no result in group %d, continue"
,
p
QI
nfo
,
pGroupResInfo
->
currentGroup
);
qDebug
(
"QInfo:%p no result in group %d, continue"
,
p
RuntimeEnv
->
qi
nfo
,
pGroupResInfo
->
currentGroup
);
cleanupGroupResInfo
(
pGroupResInfo
);
incNextGroup
(
pGroupResInfo
);
}
...
...
@@ -566,9 +565,9 @@ int32_t mergeIntoGroupResult(SGroupResInfo* pGroupResInfo, SQInfo *pQInfo) {
}
int64_t
elapsedTime
=
taosGetTimestampUs
()
-
st
;
qDebug
(
"QInfo:%p merge res data into group, index:%d, total group:%d, elapsed time:%"
PRId64
"us"
,
p
QI
nfo
,
qDebug
(
"QInfo:%p merge res data into group, index:%d, total group:%d, elapsed time:%"
PRId64
"us"
,
p
RuntimeEnv
->
qi
nfo
,
pGroupResInfo
->
currentGroup
,
pGroupResInfo
->
totalGroup
,
elapsedTime
);
pQInfo
->
summary
.
firstStageMergeTime
+=
elapsedTime
;
//
pQInfo->summary.firstStageMergeTime += elapsedTime;
return
TSDB_CODE_SUCCESS
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录