Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d87bb5f3
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d87bb5f3
编写于
5月 27, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(query): set the block groupId for stream block.
上级
ab104d86
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
25 addition
and
17 deletion
+25
-17
include/libs/executor/executor.h
include/libs/executor/executor.h
+2
-2
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-2
source/dnode/vnode/src/tsdb/tsdbSma.c
source/dnode/vnode/src/tsdb/tsdbSma.c
+1
-1
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+3
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+7
-6
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+7
-1
source/libs/stream/src/tstream.c
source/libs/stream/src/tstream.c
+2
-2
未找到文件。
include/libs/executor/executor.h
浏览文件 @
d87bb5f3
...
@@ -61,7 +61,7 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, void* streamReadHandle);
...
@@ -61,7 +61,7 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, void* streamReadHandle);
* @param type
* @param type
* @return
* @return
*/
*/
int32_t
qSetStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
input
,
int32_t
type
);
int32_t
qSetStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
input
,
int32_t
type
,
bool
assignUid
);
/**
/**
* Set multiple input data blocks for the stream scan.
* Set multiple input data blocks for the stream scan.
...
@@ -71,7 +71,7 @@ int32_t qSetStreamInput(qTaskInfo_t tinfo, const void* input, int32_t type);
...
@@ -71,7 +71,7 @@ int32_t qSetStreamInput(qTaskInfo_t tinfo, const void* input, int32_t type);
* @param type
* @param type
* @return
* @return
*/
*/
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
);
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
,
bool
assignUid
);
/**
/**
* Update the table id list, add or remove.
* Update the table id list, add or remove.
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
d87bb5f3
...
@@ -374,7 +374,7 @@ static FORCE_INLINE int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int3
...
@@ -374,7 +374,7 @@ static FORCE_INLINE int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int3
smaDebug
(
"vgId:%d execute rsma %"
PRIi8
" task for qTaskInfo:%p suid:%"
PRIu64
,
SMA_VID
(
pSma
),
level
,
taskInfo
,
suid
);
smaDebug
(
"vgId:%d execute rsma %"
PRIi8
" task for qTaskInfo:%p suid:%"
PRIu64
,
SMA_VID
(
pSma
),
level
,
taskInfo
,
suid
);
qSetStreamInput
(
taskInfo
,
pMsg
,
inputType
);
qSetStreamInput
(
taskInfo
,
pMsg
,
inputType
,
true
);
while
(
1
)
{
while
(
1
)
{
SSDataBlock
*
output
=
NULL
;
SSDataBlock
*
output
=
NULL
;
uint64_t
ts
;
uint64_t
ts
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
d87bb5f3
...
@@ -264,7 +264,7 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
...
@@ -264,7 +264,7 @@ int32_t tqPushMsgNew(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_
if
(
pExec
->
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
if
(
pExec
->
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
qTaskInfo_t
task
=
pExec
->
task
[
workerId
];
qTaskInfo_t
task
=
pExec
->
task
[
workerId
];
ASSERT
(
task
);
ASSERT
(
task
);
qSetStreamInput
(
task
,
pReq
,
STREAM_DATA_TYPE_SUBMIT_BLOCK
);
qSetStreamInput
(
task
,
pReq
,
STREAM_DATA_TYPE_SUBMIT_BLOCK
,
false
);
while
(
1
)
{
while
(
1
)
{
SSDataBlock
*
pDataBlock
=
NULL
;
SSDataBlock
*
pDataBlock
=
NULL
;
uint64_t
ts
=
0
;
uint64_t
ts
=
0
;
...
@@ -510,7 +510,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
...
@@ -510,7 +510,7 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
if
(
pExec
->
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
if
(
pExec
->
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
qTaskInfo_t
task
=
pExec
->
task
[
workerId
];
qTaskInfo_t
task
=
pExec
->
task
[
workerId
];
ASSERT
(
task
);
ASSERT
(
task
);
qSetStreamInput
(
task
,
pCont
,
STREAM_DATA_TYPE_SUBMIT_BLOCK
);
qSetStreamInput
(
task
,
pCont
,
STREAM_DATA_TYPE_SUBMIT_BLOCK
,
false
);
while
(
1
)
{
while
(
1
)
{
SSDataBlock
*
pDataBlock
=
NULL
;
SSDataBlock
*
pDataBlock
=
NULL
;
uint64_t
ts
=
0
;
uint64_t
ts
=
0
;
...
...
source/dnode/vnode/src/tsdb/tsdbSma.c
浏览文件 @
d87bb5f3
...
@@ -2015,7 +2015,7 @@ static FORCE_INLINE int32_t tsdbExecuteRSmaImpl(STsdb *pTsdb, const void *pMsg,
...
@@ -2015,7 +2015,7 @@ static FORCE_INLINE int32_t tsdbExecuteRSmaImpl(STsdb *pTsdb, const void *pMsg,
tsdbDebug
(
"vgId:%d execute rsma %"
PRIi8
" task for qTaskInfo:%p suid:%"
PRIu64
,
REPO_ID
(
pTsdb
),
level
,
taskInfo
,
tsdbDebug
(
"vgId:%d execute rsma %"
PRIi8
" task for qTaskInfo:%p suid:%"
PRIu64
,
REPO_ID
(
pTsdb
),
level
,
taskInfo
,
suid
);
suid
);
qSetStreamInput
(
taskInfo
,
pMsg
,
inputType
);
qSetStreamInput
(
taskInfo
,
pMsg
,
inputType
,
true
);
while
(
1
)
{
while
(
1
)
{
SSDataBlock
*
output
=
NULL
;
SSDataBlock
*
output
=
NULL
;
uint64_t
ts
;
uint64_t
ts
;
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
d87bb5f3
...
@@ -371,6 +371,7 @@ typedef struct SessionWindowSupporter {
...
@@ -371,6 +371,7 @@ typedef struct SessionWindowSupporter {
SStreamAggSupporter
*
pStreamAggSup
;
SStreamAggSupporter
*
pStreamAggSup
;
int64_t
gap
;
int64_t
gap
;
}
SessionWindowSupporter
;
}
SessionWindowSupporter
;
typedef
struct
SStreamBlockScanInfo
{
typedef
struct
SStreamBlockScanInfo
{
SArray
*
pBlockLists
;
// multiple SSDatablock.
SArray
*
pBlockLists
;
// multiple SSDatablock.
SSDataBlock
*
pRes
;
// result SSDataBlock
SSDataBlock
*
pRes
;
// result SSDataBlock
...
@@ -379,7 +380,6 @@ typedef struct SStreamBlockScanInfo {
...
@@ -379,7 +380,6 @@ typedef struct SStreamBlockScanInfo {
int32_t
blockType
;
// current block type
int32_t
blockType
;
// current block type
int32_t
validBlockIndex
;
// Is current data has returned?
int32_t
validBlockIndex
;
// Is current data has returned?
SColumnInfo
*
pCols
;
// the output column info
SColumnInfo
*
pCols
;
// the output column info
uint64_t
numOfRows
;
// total scanned rows
uint64_t
numOfExec
;
// execution times
uint64_t
numOfExec
;
// execution times
void
*
streamBlockReader
;
// stream block reader handle
void
*
streamBlockReader
;
// stream block reader handle
SArray
*
pColMatchInfo
;
//
SArray
*
pColMatchInfo
;
//
...
@@ -394,8 +394,9 @@ typedef struct SStreamBlockScanInfo {
...
@@ -394,8 +394,9 @@ typedef struct SStreamBlockScanInfo {
SOperatorInfo
*
pOperatorDumy
;
SOperatorInfo
*
pOperatorDumy
;
SInterval
interval
;
// if the upstream is an interval operator, the interval info is also kept here.
SInterval
interval
;
// if the upstream is an interval operator, the interval info is also kept here.
SCatchSupporter
childAggSup
;
SCatchSupporter
childAggSup
;
SArray
*
childIds
;
SArray
*
childIds
;
SessionWindowSupporter
sessionSup
;
SessionWindowSupporter
sessionSup
;
bool
assignBlockUid
;
// assign block uid to groupId, temporarily used for generating rollup SMA.
}
SStreamBlockScanInfo
;
}
SStreamBlockScanInfo
;
typedef
struct
SSysTableScanInfo
{
typedef
struct
SSysTableScanInfo
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
d87bb5f3
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "tdatablock.h"
#include "tdatablock.h"
#include "vnode.h"
#include "vnode.h"
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
char
*
id
)
{
static
int32_t
doSetStreamBlock
(
SOperatorInfo
*
pOperator
,
void
*
input
,
size_t
numOfBlocks
,
int32_t
type
,
bool
assignUid
,
char
*
id
)
{
ASSERT
(
pOperator
!=
NULL
);
ASSERT
(
pOperator
!=
NULL
);
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
if
(
pOperator
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
if
(
pOperator
->
numOfDownstream
==
0
)
{
if
(
pOperator
->
numOfDownstream
==
0
)
{
...
@@ -32,11 +32,12 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
...
@@ -32,11 +32,12 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
return
TSDB_CODE_QRY_APP_ERROR
;
return
TSDB_CODE_QRY_APP_ERROR
;
}
}
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
status
=
OP_NOT_OPENED
;
return
doSetStreamBlock
(
pOperator
->
pDownstream
[
0
],
input
,
numOfBlocks
,
type
,
id
);
return
doSetStreamBlock
(
pOperator
->
pDownstream
[
0
],
input
,
numOfBlocks
,
type
,
assignUid
,
id
);
}
else
{
}
else
{
pOperator
->
status
=
OP_NOT_OPENED
;
pOperator
->
status
=
OP_NOT_OPENED
;
SStreamBlockScanInfo
*
pInfo
=
pOperator
->
info
;
SStreamBlockScanInfo
*
pInfo
=
pOperator
->
info
;
pInfo
->
assignBlockUid
=
assignUid
;
// the block type can not be changed in the streamscan operators
// the block type can not be changed in the streamscan operators
if
(
pInfo
->
blockType
==
0
)
{
if
(
pInfo
->
blockType
==
0
)
{
...
@@ -67,11 +68,11 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
...
@@ -67,11 +68,11 @@ static int32_t doSetStreamBlock(SOperatorInfo* pOperator, void* input, size_t nu
}
}
}
}
int32_t
qSetStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
input
,
int32_t
type
)
{
int32_t
qSetStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
input
,
int32_t
type
,
bool
assignUid
)
{
return
qSetMultiStreamInput
(
tinfo
,
input
,
1
,
type
);
return
qSetMultiStreamInput
(
tinfo
,
input
,
1
,
type
,
assignUid
);
}
}
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
)
{
int32_t
qSetMultiStreamInput
(
qTaskInfo_t
tinfo
,
const
void
*
pBlocks
,
size_t
numOfBlocks
,
int32_t
type
,
bool
assignUid
)
{
if
(
tinfo
==
NULL
)
{
if
(
tinfo
==
NULL
)
{
return
TSDB_CODE_QRY_APP_ERROR
;
return
TSDB_CODE_QRY_APP_ERROR
;
}
}
...
@@ -82,7 +83,7 @@ int32_t qSetMultiStreamInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numO
...
@@ -82,7 +83,7 @@ int32_t qSetMultiStreamInput(qTaskInfo_t tinfo, const void* pBlocks, size_t numO
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
SExecTaskInfo
*
pTaskInfo
=
(
SExecTaskInfo
*
)
tinfo
;
int32_t
code
=
doSetStreamBlock
(
pTaskInfo
->
pRoot
,
(
void
**
)
pBlocks
,
numOfBlocks
,
type
,
GET_TASKID
(
pTaskInfo
));
int32_t
code
=
doSetStreamBlock
(
pTaskInfo
->
pRoot
,
(
void
**
)
pBlocks
,
numOfBlocks
,
type
,
assignUid
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"%s failed to set the stream block data"
,
GET_TASKID
(
pTaskInfo
));
qError
(
"%s failed to set the stream block data"
,
GET_TASKID
(
pTaskInfo
));
}
else
{
}
else
{
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
d87bb5f3
...
@@ -878,6 +878,12 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
...
@@ -878,6 +878,12 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
pInfo
->
pRes
->
info
.
uid
=
uid
;
pInfo
->
pRes
->
info
.
uid
=
uid
;
pInfo
->
pRes
->
info
.
type
=
STREAM_NORMAL
;
pInfo
->
pRes
->
info
.
type
=
STREAM_NORMAL
;
// for generating rollup SMA result, each time is an independent time serie.
// TODO temporarily used, when the statement of "partition by tbname" is ready, remove this
if
(
pInfo
->
assignBlockUid
)
{
pInfo
->
pRes
->
info
.
groupId
=
uid
;
}
int32_t
numOfCols
=
pInfo
->
pRes
->
info
.
numOfCols
;
int32_t
numOfCols
=
pInfo
->
pRes
->
info
.
numOfCols
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColMatchInfo
*
pColMatchInfo
=
taosArrayGet
(
pInfo
->
pColMatchInfo
,
i
);
SColMatchInfo
*
pColMatchInfo
=
taosArrayGet
(
pInfo
->
pColMatchInfo
,
i
);
...
@@ -918,7 +924,7 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
...
@@ -918,7 +924,7 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
// record the scan action.
// record the scan action.
pInfo
->
numOfExec
++
;
pInfo
->
numOfExec
++
;
p
Info
->
numOf
Rows
+=
pBlockInfo
->
rows
;
p
Operator
->
resultInfo
.
total
Rows
+=
pBlockInfo
->
rows
;
if
(
rows
==
0
)
{
if
(
rows
==
0
)
{
pOperator
->
status
=
OP_EXEC_DONE
;
pOperator
->
status
=
OP_EXEC_DONE
;
...
...
source/libs/stream/src/tstream.c
浏览文件 @
d87bb5f3
...
@@ -141,13 +141,13 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
...
@@ -141,13 +141,13 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
SStreamDataSubmit
*
pSubmit
=
(
SStreamDataSubmit
*
)
data
;
SStreamDataSubmit
*
pSubmit
=
(
SStreamDataSubmit
*
)
data
;
ASSERT
(
pSubmit
->
type
==
STREAM_INPUT__DATA_SUBMIT
);
ASSERT
(
pSubmit
->
type
==
STREAM_INPUT__DATA_SUBMIT
);
qSetStreamInput
(
exec
,
pSubmit
->
data
,
STREAM_DATA_TYPE_SUBMIT_BLOCK
);
qSetStreamInput
(
exec
,
pSubmit
->
data
,
STREAM_DATA_TYPE_SUBMIT_BLOCK
,
false
);
}
else
if
(
pTask
->
inputType
==
STREAM_INPUT__DATA_BLOCK
)
{
}
else
if
(
pTask
->
inputType
==
STREAM_INPUT__DATA_BLOCK
)
{
SStreamDataBlock
*
pBlock
=
(
SStreamDataBlock
*
)
data
;
SStreamDataBlock
*
pBlock
=
(
SStreamDataBlock
*
)
data
;
ASSERT
(
pBlock
->
type
==
STREAM_INPUT__DATA_BLOCK
);
ASSERT
(
pBlock
->
type
==
STREAM_INPUT__DATA_BLOCK
);
SArray
*
blocks
=
pBlock
->
blocks
;
SArray
*
blocks
=
pBlock
->
blocks
;
qSetMultiStreamInput
(
exec
,
blocks
->
pData
,
blocks
->
size
,
STREAM_DATA_TYPE_SSDATA_BLOCK
);
qSetMultiStreamInput
(
exec
,
blocks
->
pData
,
blocks
->
size
,
STREAM_DATA_TYPE_SSDATA_BLOCK
,
false
);
}
}
// exec
// exec
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录