Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7e01d092
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
7e01d092
编写于
2月 21, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimize repeat scan
上级
09ce8182
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
7 deletion
+14
-7
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+3
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+8
-3
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+2
-1
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+1
-1
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
7e01d092
...
...
@@ -395,19 +395,20 @@ void applyAggFunctionOnPartialTuples(SExecTaskInfo* taskInfo, SqlFunctionCtx* pC
}
}
static
void
doSetInputDataBlockInfo
(
SExprSupp
*
pExprSup
,
SSDataBlock
*
pBlock
,
int32_t
order
)
{
static
void
doSetInputDataBlockInfo
(
SExprSupp
*
pExprSup
,
SSDataBlock
*
pBlock
,
int32_t
order
,
int32_t
scanFlag
)
{
SqlFunctionCtx
*
pCtx
=
pExprSup
->
pCtx
;
for
(
int32_t
i
=
0
;
i
<
pExprSup
->
numOfExprs
;
++
i
)
{
pCtx
[
i
].
order
=
order
;
pCtx
[
i
].
input
.
numOfRows
=
pBlock
->
info
.
rows
;
setBlockSMAInfo
(
&
pCtx
[
i
],
&
pExprSup
->
pExprInfo
[
i
],
pBlock
);
pCtx
[
i
].
pSrcBlock
=
pBlock
;
pCtx
[
i
].
scanFlag
=
scanFlag
;
}
}
void
setInputDataBlock
(
SExprSupp
*
pExprSup
,
SSDataBlock
*
pBlock
,
int32_t
order
,
int32_t
scanFlag
,
bool
createDummyCol
)
{
if
(
pBlock
->
pBlockAgg
!=
NULL
)
{
doSetInputDataBlockInfo
(
pExprSup
,
pBlock
,
order
);
doSetInputDataBlockInfo
(
pExprSup
,
pBlock
,
order
,
scanFlag
);
}
else
{
doSetInputDataBlock
(
pExprSup
,
pBlock
,
order
,
scanFlag
,
createDummyCol
);
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
7e01d092
...
...
@@ -699,7 +699,8 @@ static SSDataBlock* doGroupedTableScan(SOperatorInfo* pOperator) {
if
(
pTableScanInfo
->
scanTimes
<
pTableScanInfo
->
scanInfo
.
numOfAsc
)
{
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
pTableScanInfo
->
base
.
scanFlag
=
REPEAT_SCAN
;
pTableScanInfo
->
base
.
scanFlag
=
MAIN_SCAN
;
pTableScanInfo
->
base
.
dataBlockLoadFlag
=
FUNC_DATA_REQUIRED_DATA_LOAD
;
qDebug
(
"start to repeat ascending order scan data blocks due to query func required, %s"
,
GET_TASKID
(
pTaskInfo
));
// do prepare for the next round table scan operation
...
...
@@ -725,7 +726,7 @@ static SSDataBlock* doGroupedTableScan(SOperatorInfo* pOperator) {
if
(
pTableScanInfo
->
scanTimes
<
total
)
{
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
pTableScanInfo
->
base
.
scanFlag
=
REPEAT
_SCAN
;
pTableScanInfo
->
base
.
scanFlag
=
MAIN
_SCAN
;
qDebug
(
"%s start to repeat descending order scan data blocks"
,
GET_TASKID
(
pTaskInfo
));
tsdbReaderReset
(
pTableScanInfo
->
base
.
dataReader
,
&
pTableScanInfo
->
base
.
cond
);
...
...
@@ -878,7 +879,11 @@ SOperatorInfo* createTableScanOperatorInfo(STableScanPhysiNode* pTableScanNode,
pInfo
->
scanInfo
=
(
SScanInfo
){.
numOfAsc
=
pTableScanNode
->
scanSeq
[
0
],
.
numOfDesc
=
pTableScanNode
->
scanSeq
[
1
]};
pInfo
->
base
.
scanFlag
=
MAIN_SCAN
;
if
(
pInfo
->
scanInfo
.
numOfAsc
>
1
)
{
pInfo
->
base
.
scanFlag
=
REPEAT_SCAN
;
}
else
{
pInfo
->
base
.
scanFlag
=
MAIN_SCAN
;
}
pInfo
->
base
.
pdInfo
.
interval
=
extractIntervalInfo
(
pTableScanNode
);
pInfo
->
base
.
readHandle
=
*
readHandle
;
pInfo
->
base
.
dataBlockLoadFlag
=
pTableScanNode
->
dataRequired
;
...
...
source/libs/function/src/builtins.c
浏览文件 @
7e01d092
...
...
@@ -2276,8 +2276,9 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.
name
=
"percentile"
,
.
type
=
FUNCTION_TYPE_PERCENTILE
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_REPEAT_SCAN_FUNC
|
FUNC_MGT_FORBID_STREAM_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_REPEAT_SCAN_FUNC
|
FUNC_MGT_
SPECIAL_DATA_REQUIRED
|
FUNC_MGT_
FORBID_STREAM_FUNC
,
.
translateFunc
=
translatePercentile
,
.
dataRequiredFunc
=
statisDataRequired
,
.
getEnvFunc
=
getPercentileFuncEnv
,
.
initFunc
=
percentileFunctionSetup
,
.
processFunc
=
percentileFunction
,
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
7e01d092
...
...
@@ -1578,7 +1578,7 @@ int32_t percentileFunction(SqlFunctionCtx* pCtx) {
int32_t
type
=
pCol
->
info
.
type
;
SPercentileInfo
*
pInfo
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
if
(
pCtx
->
scanFlag
==
REPEAT
_SCAN
&&
pInfo
->
stage
==
0
)
{
if
(
pCtx
->
scanFlag
==
MAIN
_SCAN
&&
pInfo
->
stage
==
0
)
{
pInfo
->
stage
+=
1
;
// all data are null, set it completed
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录