Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b67c6531
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看板
提交
b67c6531
编写于
6月 27, 2022
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: add group to multi-merge operator
上级
732a91c9
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
40 addition
and
9 deletion
+40
-9
include/common/tdatablock.h
include/common/tdatablock.h
+1
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+1
-1
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+1
-1
source/libs/executor/inc/tsort.h
source/libs/executor/inc/tsort.h
+7
-0
source/libs/executor/src/sortoperator.c
source/libs/executor/src/sortoperator.c
+25
-5
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+4
-0
未找到文件。
include/common/tdatablock.h
浏览文件 @
b67c6531
...
...
@@ -236,7 +236,7 @@ void blockCompressEncode(const SSDataBlock* pBlock, char* data, int32_t*
int8_t
needCompress
);
const
char
*
blockCompressDecode
(
SSDataBlock
*
pBlock
,
int32_t
numOfCols
,
int32_t
numOfRows
,
const
char
*
pData
);
void
blockDebugShowData
(
const
SArray
*
dataBlocks
,
const
char
*
flag
);
void
blockDebugShowData
Blocks
(
const
SArray
*
dataBlocks
,
const
char
*
flag
);
// for debug
char
*
dumpBlockData
(
SSDataBlock
*
pDataBlock
,
const
char
*
flag
,
char
**
dumpBuf
);
...
...
source/common/src/tdatablock.c
浏览文件 @
b67c6531
...
...
@@ -1613,7 +1613,7 @@ void blockDebugShowData(const SArray* dataBlocks, const char* flag) {
size_t
numOfCols
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
int32_t
rows
=
pDataBlock
->
info
.
rows
;
printf
(
"%s |block type %d |child id %d|
\n
"
,
flag
,
(
int32_t
)
pDataBlock
->
info
.
type
,
pDataBlock
->
info
.
child
Id
);
printf
(
"%s |block type %d |child id %d|
group id %zX
\n
"
,
flag
,
(
int32_t
)
pDataBlock
->
info
.
type
,
pDataBlock
->
info
.
childId
,
pDataBlock
->
info
.
group
Id
);
for
(
int32_t
j
=
0
;
j
<
rows
;
j
++
)
{
printf
(
"%s |"
,
flag
);
for
(
int32_t
k
=
0
;
k
<
numOfCols
;
k
++
)
{
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
b67c6531
...
...
@@ -462,7 +462,7 @@ static int32_t tdFetchAndSubmitRSmaResult(SRSmaInfoItem *pItem, int8_t blkType)
#if 1
char
flag
[
10
]
=
{
0
};
snprintf
(
flag
,
10
,
"level %"
PRIi8
,
pItem
->
level
);
blockDebugShowData
(
pResult
,
flag
);
blockDebugShowData
Blocks
(
pResult
,
flag
);
#endif
STsdb
*
sinkTsdb
=
(
pItem
->
level
==
TSDB_RETENTION_L1
?
pSma
->
pRSmaTsdb1
:
pSma
->
pRSmaTsdb2
);
SSubmitReq
*
pReq
=
NULL
;
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
b67c6531
...
...
@@ -299,7 +299,7 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, int64_t version, SRpcMsg *pMsg, SRp
void
smaHandleRes
(
void
*
pVnode
,
int64_t
smaId
,
const
SArray
*
data
)
{
// TODO
blockDebugShowData
(
data
,
__func__
);
blockDebugShowData
Blocks
(
data
,
__func__
);
tdProcessTSmaInsert
(((
SVnode
*
)
pVnode
)
->
pSma
,
smaId
,
(
const
char
*
)
data
);
}
...
...
source/libs/executor/inc/tsort.h
浏览文件 @
b67c6531
...
...
@@ -136,6 +136,13 @@ bool tsortIsNullVal(STupleHandle* pVHandle, int32_t colId);
*/
void
*
tsortGetValue
(
STupleHandle
*
pVHandle
,
int32_t
colId
);
/**
*
* @param pVHandle
* @return
*/
uint64_t
tsortGetGroupId
(
STupleHandle
*
pVHandle
);
/**
*
* @param pSortHandle
...
...
source/libs/executor/src/sortoperator.c
浏览文件 @
b67c6531
...
...
@@ -142,7 +142,8 @@ SSDataBlock* getSortedBlockData(SSortHandle* pHandle, SSDataBlock* pDataBlock, i
SSDataBlock
*
loadNextDataBlock
(
void
*
param
)
{
SOperatorInfo
*
pOperator
=
(
SOperatorInfo
*
)
param
;
return
pOperator
->
fpSet
.
getNextFn
(
pOperator
);
SSDataBlock
*
pBlock
=
pOperator
->
fpSet
.
getNextFn
(
pOperator
);
return
pBlock
;
}
// todo refactor: merged with fetch fp
...
...
@@ -505,7 +506,9 @@ typedef struct SMultiwaySortMergeOperatorInfo {
SSDataBlock
*
pInputBlock
;
int64_t
startTs
;
// sort start time
bool
hasGroupId
;
uint64_t
groupId
;
STupleHandle
*
prefetchedTuple
;
}
SMultiwaySortMergeOperatorInfo
;
int32_t
doOpenMultiwaySortMergeOperator
(
SOperatorInfo
*
pOperator
)
{
...
...
@@ -560,12 +563,30 @@ SSDataBlock* getMultiwaySortedBlockData(SSortHandle* pHandle, SSDataBlock* pData
blockDataEnsureCapacity
(
p
,
capacity
);
while
(
1
)
{
STupleHandle
*
pTupleHandle
=
tsortNextTuple
(
pHandle
);
STupleHandle
*
pTupleHandle
=
NULL
;
if
(
pInfo
->
prefetchedTuple
==
NULL
)
{
pTupleHandle
=
tsortNextTuple
(
pHandle
);
}
else
{
pTupleHandle
=
pInfo
->
prefetchedTuple
;
pInfo
->
groupId
=
tsortGetGroupId
(
pTupleHandle
);
pInfo
->
prefetchedTuple
=
NULL
;
}
if
(
pTupleHandle
==
NULL
)
{
break
;
}
uint64_t
tupleGroupId
=
tsortGetGroupId
(
pTupleHandle
);
if
(
!
pInfo
->
hasGroupId
)
{
pInfo
->
groupId
=
tupleGroupId
;
pInfo
->
hasGroupId
=
true
;
appendOneRowToDataBlock
(
p
,
pTupleHandle
);
}
else
if
(
pInfo
->
groupId
==
tupleGroupId
)
{
appendOneRowToDataBlock
(
p
,
pTupleHandle
);
}
else
{
pInfo
->
prefetchedTuple
=
pTupleHandle
;
break
;
}
if
(
p
->
info
.
rows
>=
capacity
)
{
break
;
}
...
...
@@ -608,7 +629,6 @@ SSDataBlock* doMultiwaySortMerge(SOperatorInfo* pOperator) {
SSDataBlock
*
pBlock
=
getMultiwaySortedBlockData
(
pInfo
->
pSortHandle
,
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
,
pInfo
->
pColMatchInfo
,
pOperator
);
if
(
pBlock
!=
NULL
)
{
pOperator
->
resultInfo
.
totalRows
+=
pBlock
->
info
.
rows
;
}
else
{
...
...
source/libs/executor/src/tsort.c
浏览文件 @
b67c6531
...
...
@@ -752,6 +752,10 @@ void* tsortGetValue(STupleHandle* pVHandle, int32_t colIndex) {
}
}
uint64_t
tsortGetGroupId
(
STupleHandle
*
pVHandle
)
{
return
pVHandle
->
pBlock
->
info
.
groupId
;
}
SSortExecInfo
tsortGetSortExecInfo
(
SSortHandle
*
pHandle
)
{
SSortExecInfo
info
=
{
0
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录