Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4fa20a1e
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看板
提交
4fa20a1e
编写于
6月 14, 2022
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add table merge scan operator
上级
1b1d1d1c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
22 deletion
+26
-22
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+26
-22
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
4fa20a1e
...
...
@@ -1791,7 +1791,7 @@ typedef struct STableMergeScanInfo {
uint64_t
groupId
;
STupleHandle
*
prefetchedTuple
;
SArray
*
sortSourceParams
;
SArray
*
sortSourceParams
;
SFileBlockLoadRecorder
readRecorder
;
int64_t
numOfRows
;
...
...
@@ -1842,12 +1842,17 @@ int32_t createMultipleDataReaders(STableScanPhysiNode* pTableScanNode, SReadHand
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
}
// TODO: free the sublist info and the table list in it
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pTableListInfo
->
pTableList
);
++
i
)
{
STableListInfo
*
subListInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
subListInfo
));
subListInfo
->
pTableList
=
taosArrayInit
(
1
,
sizeof
(
STableKeyInfo
));
taosArrayPush
(
subListInfo
->
pTableList
,
taosArrayGet
(
pTableListInfo
->
pTableList
,
i
));
tsdbReaderT
*
pReader
=
tsdbReaderOpen
(
pHandle
->
vnode
,
&
cond
,
pTableListInfo
,
queryId
,
taskId
);
tsdbReaderT
*
pReader
=
tsdbReaderOpen
(
pHandle
->
vnode
,
&
cond
,
subListInfo
,
queryId
,
taskId
);
taosArrayPush
(
arrayReader
,
&
pReader
);
taosArrayDestroy
(
subListInfo
->
pTableList
);
taosMemoryFree
(
subListInfo
);
}
clearupQueryTableDataCond
(
&
cond
);
...
...
@@ -2042,8 +2047,6 @@ int32_t doOpenTableMergeScanOperator(SOperatorInfo* pOperator) {
return
TSDB_CODE_SUCCESS
;
}
pInfo
->
startTs
=
taosGetTimestampUs
();
int32_t
numOfBufPage
=
pInfo
->
sortBufSize
/
pInfo
->
bufPageSize
;
pInfo
->
pSortHandle
=
...
...
@@ -2074,7 +2077,8 @@ int32_t doOpenTableMergeScanOperator(SOperatorInfo* pOperator) {
return
TSDB_CODE_SUCCESS
;
}
SSDataBlock
*
getSortedTableMergeScanBlockData
(
SSortHandle
*
pHandle
,
SSDataBlock
*
pDataBlock
,
int32_t
capacity
,
SOperatorInfo
*
pOperator
)
{
SSDataBlock
*
getSortedTableMergeScanBlockData
(
SSortHandle
*
pHandle
,
SSDataBlock
*
pDataBlock
,
int32_t
capacity
,
SOperatorInfo
*
pOperator
)
{
STableMergeScanInfo
*
pInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
...
...
@@ -2137,8 +2141,8 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) {
longjmp
(
pTaskInfo
->
env
,
code
);
}
SSDataBlock
*
pBlock
=
getSortedTableMergeScanBlockData
(
pInfo
->
pSortHandle
,
pInfo
->
pResBlock
,
pOperator
->
resultInfo
.
capacity
,
pOperator
);
SSDataBlock
*
pBlock
=
getSortedTableMergeScanBlockData
(
pInfo
->
pSortHandle
,
pInfo
->
pResBlock
,
pOperator
->
resultInfo
.
capacity
,
pOperator
);
if
(
pBlock
!=
NULL
)
{
pOperator
->
resultInfo
.
totalRows
+=
pBlock
->
info
.
rows
;
...
...
@@ -2154,7 +2158,7 @@ void destroyTableMergeScanOperatorInfo(void* param, int32_t numOfOutput) {
clearupQueryTableDataCond
(
&
pTableScanInfo
->
cond
);
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pTableScanInfo
->
dataReaders
);
++
i
)
{
tsdbReaderT
*
reader
=
taosArrayGetP
(
pTableScanInfo
->
dataReaders
,
i
);
tsdbReaderT
*
reader
=
taosArrayGetP
(
pTableScanInfo
->
dataReaders
,
i
);
tsdbCleanupReadHandle
(
reader
);
}
taosArrayDestroy
(
pTableScanInfo
->
dataReaders
);
...
...
@@ -2170,22 +2174,22 @@ void destroyTableMergeScanOperatorInfo(void* param, int32_t numOfOutput) {
taosArrayDestroy
(
pTableScanInfo
->
pSortInfo
);
}
typedef
struct
STableMergeScanExecInfo
{
SFileBlockLoadRecorder
blockRecorder
;
SSortExecInfo
sortExecInfo
;
}
STableMergeScanExecInfo
;
int32_t
getTableMergeScanExplainExecInfo
(
SOperatorInfo
*
pOptr
,
void
**
pOptrExplain
,
uint32_t
*
len
)
{
ASSERT
(
pOptr
!=
NULL
);
//TODO: merge these two info into one struct
SFileBlockLoadRecorder
*
pRecorder
=
taosMemoryCalloc
(
1
,
sizeof
(
SFileBlockLoadRecorder
));
STableScanInfo
*
pTableScanInfo
=
pOptr
->
info
;
*
pRecorder
=
pTableScanInfo
->
readRecorder
;
*
pOptrExplain
=
pRecorder
;
*
len
=
sizeof
(
SFileBlockLoadRecorder
);
SSortExecInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SSortExecInfo
));
STableMergeScanInfo
*
pOperatorInfo
=
(
STableMergeScanInfo
*
)
pOptr
->
info
;
*
pInfo
=
tsortGetSortExecInfo
(
pOperatorInfo
->
pSortHandle
);
*
pOptrExplain
=
pInfo
;
*
len
=
sizeof
(
SSortExecInfo
);
// TODO: merge these two info into one struct
STableMergeScanExecInfo
*
execInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
STableMergeScanExecInfo
));
STableMergeScanInfo
*
pInfo
=
pOptr
->
info
;
execInfo
->
blockRecorder
=
pInfo
->
readRecorder
;
execInfo
->
sortExecInfo
=
tsortGetSortExecInfo
(
pInfo
->
pSortHandle
);
*
pOptrExplain
=
execInfo
;
*
len
=
sizeof
(
STableMergeScanExecInfo
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录