Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0d8dcc29
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0d8dcc29
编写于
3月 19, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-3188]
上级
18cb7b36
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
29 addition
and
7 deletion
+29
-7
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+0
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+29
-6
未找到文件。
src/client/src/tscLocalMerge.c
浏览文件 @
0d8dcc29
...
@@ -1073,7 +1073,6 @@ static void doExecuteFinalMerge(SSqlCmd *pCmd, SLocalMerger *pLocalMerge, bool n
...
@@ -1073,7 +1073,6 @@ static void doExecuteFinalMerge(SSqlCmd *pCmd, SLocalMerger *pLocalMerge, bool n
}
}
pCtx
->
currentStage
=
MERGE_STAGE
;
pCtx
->
currentStage
=
MERGE_STAGE
;
if
(
needInit
)
{
if
(
needInit
)
{
aAggs
[
pCtx
->
functionId
].
init
(
pCtx
,
pCtx
->
resultInfo
);
aAggs
[
pCtx
->
functionId
].
init
(
pCtx
,
pCtx
->
resultInfo
);
}
}
...
...
src/query/src/qExecutor.c
浏览文件 @
0d8dcc29
...
@@ -782,7 +782,13 @@ static void doApplyFunctions(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx* pCtx
...
@@ -782,7 +782,13 @@ static void doApplyFunctions(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx* pCtx
}
}
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
// aAggs[functionId].xFunction(&pCtx[k]);
if
(
functionId
<
0
)
{
// load the script and exec, pRuntimeEnv->pUdfInfo
}
else
{
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
}
}
}
// restore it
// restore it
...
@@ -1009,7 +1015,13 @@ static void doAggregateImpl(SOperatorInfo* pOperator, TSKEY startTs, SQLFunction
...
@@ -1009,7 +1015,13 @@ static void doAggregateImpl(SOperatorInfo* pOperator, TSKEY startTs, SQLFunction
int32_t
functionId
=
pCtx
[
k
].
functionId
;
int32_t
functionId
=
pCtx
[
k
].
functionId
;
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
if
(
functionNeedToExecute
(
pRuntimeEnv
,
&
pCtx
[
k
],
functionId
))
{
pCtx
[
k
].
startTs
=
startTs
;
// this can be set during create the struct
pCtx
[
k
].
startTs
=
startTs
;
// this can be set during create the struct
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
// aAggs[functionId].xFunction(&pCtx[k]);
if
(
functionId
<
0
)
{
// load the script and exec, pRuntimeEnv->pUdfInfo
}
else
{
aAggs
[
functionId
].
xFunction
(
&
pCtx
[
k
]);
}
}
}
}
}
}
}
...
@@ -1019,7 +1031,13 @@ static void arithmeticApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionC
...
@@ -1019,7 +1031,13 @@ static void arithmeticApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionC
for
(
int32_t
k
=
0
;
k
<
numOfOutput
;
++
k
)
{
for
(
int32_t
k
=
0
;
k
<
numOfOutput
;
++
k
)
{
pCtx
[
k
].
startTs
=
pQuery
->
window
.
skey
;
pCtx
[
k
].
startTs
=
pQuery
->
window
.
skey
;
aAggs
[
pCtx
[
k
].
functionId
].
xFunction
(
&
pCtx
[
k
]);
if
(
pCtx
[
k
].
functionId
<
0
)
{
// load the script and exec, pRuntimeEnv->pUdfInfo
}
else
{
aAggs
[
pCtx
[
k
].
functionId
].
xFunction
(
&
pCtx
[
k
]);
}
}
}
}
}
...
@@ -2480,9 +2498,14 @@ static uint32_t doFilterByBlockTimeWindow(STableScanInfo* pTableScanInfo, SSData
...
@@ -2480,9 +2498,14 @@ static uint32_t doFilterByBlockTimeWindow(STableScanInfo* pTableScanInfo, SSData
int32_t
colId
=
pTableScanInfo
->
pExpr
[
i
].
base
.
colInfo
.
colId
;
int32_t
colId
=
pTableScanInfo
->
pExpr
[
i
].
base
.
colInfo
.
colId
;
// group by + first/last should not apply the first/last block filter
// group by + first/last should not apply the first/last block filter
status
|=
aAggs
[
functionId
].
dataReqFunc
(
&
pTableScanInfo
->
pCtx
[
i
],
&
pBlock
->
info
.
window
,
colId
);
if
(
functionId
<
0
)
{
if
((
status
&
BLK_DATA_ALL_NEEDED
)
==
BLK_DATA_ALL_NEEDED
)
{
status
|=
BLK_DATA_ALL_NEEDED
;
return
status
;
return
status
;
}
else
{
status
|=
aAggs
[
functionId
].
dataReqFunc
(
&
pTableScanInfo
->
pCtx
[
i
],
&
pBlock
->
info
.
window
,
colId
);
if
((
status
&
BLK_DATA_ALL_NEEDED
)
==
BLK_DATA_ALL_NEEDED
)
{
return
status
;
}
}
}
}
}
...
@@ -3060,7 +3083,7 @@ void initCtxOutputBuffer(SQLFunctionCtx* pCtx, int32_t size) {
...
@@ -3060,7 +3083,7 @@ void initCtxOutputBuffer(SQLFunctionCtx* pCtx, int32_t size) {
continue
;
continue
;
}
}
if
(
pCtx
[
j
].
functionId
<
0
)
{
//
udf initialize
if
(
pCtx
[
j
].
functionId
<
0
)
{
//
todo udf initialization
}
else
{
}
else
{
aAggs
[
pCtx
[
j
].
functionId
].
init
(
&
pCtx
[
j
],
pCtx
[
j
].
resultInfo
);
aAggs
[
pCtx
[
j
].
functionId
].
init
(
&
pCtx
[
j
],
pCtx
[
j
].
resultInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录