Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
692ba8cc
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看板
提交
692ba8cc
编写于
2月 01, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor some codes
上级
b445e9c4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
10 deletion
+11
-10
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+11
-10
未找到文件。
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
692ba8cc
...
...
@@ -1616,7 +1616,7 @@ static SOutputRes *doSetSlidingWindowFromKey(SSlidingWindowInfo *pSlidingWindowI
return
&
pSlidingWindowInfo
->
pResult
[
p
];
}
static
int32_t
init
Res
WindowInfo
(
SSlidingWindowInfo
*
pSlidingWindowInfo
,
int32_t
threshold
,
int16_t
type
,
static
int32_t
init
Sliding
WindowInfo
(
SSlidingWindowInfo
*
pSlidingWindowInfo
,
int32_t
threshold
,
int16_t
type
,
SOutputRes
*
pRes
)
{
pSlidingWindowInfo
->
capacity
=
threshold
;
pSlidingWindowInfo
->
threshold
=
threshold
;
...
...
@@ -1638,7 +1638,7 @@ static int32_t initResWindowInfo(SSlidingWindowInfo *pSlidingWindowInfo, int32_t
return
TSDB_CODE_SUCCESS
;
}
static
void
destroy
Res
WindowInfo
(
SSlidingWindowInfo
*
pSlidingWindowInfo
)
{
static
void
destroy
Sliding
WindowInfo
(
SSlidingWindowInfo
*
pSlidingWindowInfo
)
{
if
(
pSlidingWindowInfo
==
NULL
||
pSlidingWindowInfo
->
capacity
==
0
)
{
assert
(
pSlidingWindowInfo
->
hashList
==
NULL
&&
pSlidingWindowInfo
->
pResult
==
NULL
);
return
;
...
...
@@ -2028,9 +2028,9 @@ static int32_t rowwiseApplyAllFunctions(SQueryRuntimeEnv *pRuntimeEnv, int32_t *
lastKey
=
ts
;
int32_t
index
=
pRuntimeEnv
->
swindowResInfo
.
curIndex
;
STimeWindow
nextWin
=
win
;
while
(
1
)
{
STimeWindow
nextWin
=
{
0
};
getNextLogicalQueryRange
(
pRuntimeEnv
,
&
nextWin
);
if
(
pSlidingWindowInfo
->
startTime
>
nextWin
.
skey
||
(
nextWin
.
skey
>
pQuery
->
ekey
&&
QUERY_IS_ASC_QUERY
(
pQuery
))
||
(
nextWin
.
skey
>
pQuery
->
skey
&&
!
QUERY_IS_ASC_QUERY
(
pQuery
)))
{
...
...
@@ -2599,7 +2599,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
}
tfree
(
pRuntimeEnv
->
secondaryUnzipBuffer
);
destroy
Res
WindowInfo
(
&
pRuntimeEnv
->
swindowResInfo
);
destroy
Sliding
WindowInfo
(
&
pRuntimeEnv
->
swindowResInfo
);
if
(
pRuntimeEnv
->
pCtx
!=
NULL
)
{
for
(
int32_t
i
=
0
;
i
<
pRuntimeEnv
->
pQuery
->
numOfOutputCols
;
++
i
)
{
...
...
@@ -4294,7 +4294,7 @@ int32_t vnodeQuerySingleMeterPrepare(SQInfo *pQInfo, SMeterObj *pMeterObj, SMete
}
// todo bug!
init
Res
WindowInfo
(
&
pRuntimeEnv
->
swindowResInfo
,
3
,
type
,
pSupporter
->
pResult
);
init
Sliding
WindowInfo
(
&
pRuntimeEnv
->
swindowResInfo
,
3
,
type
,
pSupporter
->
pResult
);
}
pSupporter
->
rawSKey
=
pQuery
->
skey
;
...
...
@@ -4322,6 +4322,7 @@ int32_t vnodeQuerySingleMeterPrepare(SQInfo *pQInfo, SMeterObj *pMeterObj, SMete
}
}
else
{
// find the skey and ekey in case of sliding query
// todo refactor
if
(
pQuery
->
slidingTime
>
0
&&
pQuery
->
nAggTimeInterval
>
0
)
{
int64_t
skey
=
0
;
...
...
@@ -4422,9 +4423,10 @@ void vnodeQueryFreeQInfoEx(SQInfo *pQInfo) {
pSupporter
->
pMetersHashTable
=
NULL
;
}
if
(
pSupporter
->
pSidSet
!=
NULL
||
isGroupbyNormalCol
(
pQInfo
->
query
.
pGroupbyExpr
))
{
if
(
pSupporter
->
pSidSet
!=
NULL
||
isGroupbyNormalCol
(
pQInfo
->
query
.
pGroupbyExpr
)
||
(
pQuery
->
nAggTimeInterval
>
0
&&
pQuery
->
slidingTime
>
0
))
{
int32_t
size
=
0
;
if
(
isGroupbyNormalCol
(
pQInfo
->
query
.
pGroupbyExpr
))
{
if
(
isGroupbyNormalCol
(
pQInfo
->
query
.
pGroupbyExpr
)
||
(
pQuery
->
nAggTimeInterval
>
0
&&
pQuery
->
slidingTime
>
0
)
)
{
size
=
10000
;
}
else
if
(
pSupporter
->
pSidSet
!=
NULL
)
{
size
=
pSupporter
->
pSidSet
->
numOfSubSet
;
...
...
@@ -4534,7 +4536,7 @@ int32_t vnodeMultiMeterQueryPrepare(SQInfo *pQInfo, SQuery *pQuery, void *param)
if
(
isGroupbyNormalCol
(
pQuery
->
pGroupbyExpr
))
{
// group by columns not tags;
int16_t
type
=
getGroupbyColumnType
(
pQuery
,
pQuery
->
pGroupbyExpr
);
init
Res
WindowInfo
(
&
pRuntimeEnv
->
swindowResInfo
,
10039
,
type
,
pSupporter
->
pResult
);
init
Sliding
WindowInfo
(
&
pRuntimeEnv
->
swindowResInfo
,
10039
,
type
,
pSupporter
->
pResult
);
}
if
(
pQuery
->
nAggTimeInterval
!=
0
)
{
...
...
@@ -5735,7 +5737,6 @@ void copyGroupResultBuf(SOutputRes* dst, const SOutputRes* src, int32_t nOutputC
}
}
void
destroyGroupResultBuf
(
SOutputRes
*
pOneOutputRes
,
int32_t
nOutputCols
)
{
if
(
pOneOutputRes
==
NULL
)
{
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录