Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d17b478e
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
d17b478e
编写于
5月 08, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stream): auto create ctb
上级
db3cbbf2
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
99 addition
and
71 deletion
+99
-71
include/common/tdatablock.h
include/common/tdatablock.h
+1
-1
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+5
-4
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+12
-6
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
+1
-0
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+1
-0
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+2
-1
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+8
-0
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+14
-4
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+52
-52
source/libs/stream/src/tstream.c
source/libs/stream/src/tstream.c
+3
-3
未找到文件。
include/common/tdatablock.h
浏览文件 @
d17b478e
...
@@ -232,7 +232,7 @@ void blockDebugShowData(const SArray* dataBlocks);
...
@@ -232,7 +232,7 @@ void blockDebugShowData(const SArray* dataBlocks);
int32_t
buildSubmitReqFromDataBlock
(
SSubmitReq
**
pReq
,
const
SArray
*
pDataBlocks
,
STSchema
*
pTSchema
,
int32_t
vgId
,
int32_t
buildSubmitReqFromDataBlock
(
SSubmitReq
**
pReq
,
const
SArray
*
pDataBlocks
,
STSchema
*
pTSchema
,
int32_t
vgId
,
tb_uid_t
uid
,
tb_uid_t
suid
);
tb_uid_t
uid
,
tb_uid_t
suid
);
SSubmitReq
*
tdBlockToSubmit
(
const
SArray
*
pBlocks
,
const
STSchema
*
pSchema
,
bool
createTb
,
int64_t
suid
);
SSubmitReq
*
tdBlockToSubmit
(
const
SArray
*
pBlocks
,
const
STSchema
*
pSchema
,
bool
createTb
,
int64_t
suid
,
int32_t
vgId
);
static
FORCE_INLINE
int32_t
blockGetEncodeSize
(
const
SSDataBlock
*
pBlock
)
{
static
FORCE_INLINE
int32_t
blockGetEncodeSize
(
const
SSDataBlock
*
pBlock
)
{
return
blockDataGetSerialMetaSize
(
pBlock
)
+
blockDataGetSize
(
pBlock
);
return
blockDataGetSerialMetaSize
(
pBlock
)
+
blockDataGetSize
(
pBlock
);
...
...
include/libs/stream/tstream.h
浏览文件 @
d17b478e
...
@@ -25,6 +25,8 @@ extern "C" {
...
@@ -25,6 +25,8 @@ extern "C" {
#ifndef _TSTREAM_H_
#ifndef _TSTREAM_H_
#define _TSTREAM_H_
#define _TSTREAM_H_
typedef
struct
SStreamTask
SStreamTask
;
enum
{
enum
{
STREAM_TASK_STATUS__RUNNING
=
1
,
STREAM_TASK_STATUS__RUNNING
=
1
,
STREAM_TASK_STATUS__STOP
,
STREAM_TASK_STATUS__STOP
,
...
@@ -69,7 +71,7 @@ typedef struct {
...
@@ -69,7 +71,7 @@ typedef struct {
SUseDbRsp
dbInfo
;
SUseDbRsp
dbInfo
;
}
STaskDispatcherShuffle
;
}
STaskDispatcherShuffle
;
typedef
void
FTbSink
(
void
*
vnode
,
int64_t
ver
,
const
SArray
*
data
);
typedef
void
FTbSink
(
SStreamTask
*
pTask
,
void
*
vnode
,
int64_t
ver
,
void
*
data
);
typedef
struct
{
typedef
struct
{
int64_t
stbUid
;
int64_t
stbUid
;
...
@@ -119,7 +121,7 @@ enum {
...
@@ -119,7 +121,7 @@ enum {
TASK_SINK__FETCH
,
TASK_SINK__FETCH
,
};
};
typedef
struct
{
struct
SStreamTask
{
int64_t
streamId
;
int64_t
streamId
;
int32_t
taskId
;
int32_t
taskId
;
int8_t
status
;
int8_t
status
;
...
@@ -154,8 +156,7 @@ typedef struct {
...
@@ -154,8 +156,7 @@ typedef struct {
// application storage
// application storage
void
*
ahandle
;
void
*
ahandle
;
};
}
SStreamTask
;
SStreamTask
*
tNewSStreamTask
(
int64_t
streamId
);
SStreamTask
*
tNewSStreamTask
(
int64_t
streamId
);
int32_t
tEncodeSStreamTask
(
SEncoder
*
pEncoder
,
const
SStreamTask
*
pTask
);
int32_t
tEncodeSStreamTask
(
SEncoder
*
pEncoder
,
const
SStreamTask
*
pTask
);
...
...
source/common/src/tdatablock.c
浏览文件 @
d17b478e
...
@@ -1596,7 +1596,8 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks
...
@@ -1596,7 +1596,8 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
SSubmitReq
*
tdBlockToSubmit
(
const
SArray
*
pBlocks
,
const
STSchema
*
pTSchema
,
bool
createTb
,
int64_t
suid
)
{
SSubmitReq
*
tdBlockToSubmit
(
const
SArray
*
pBlocks
,
const
STSchema
*
pTSchema
,
bool
createTb
,
int64_t
suid
,
int32_t
vgId
)
{
SSubmitReq
*
ret
=
NULL
;
SSubmitReq
*
ret
=
NULL
;
// cal size
// cal size
...
@@ -1634,9 +1635,11 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
...
@@ -1634,9 +1635,11 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
}
}
// assign data
// assign data
ret
=
taosMemoryCalloc
(
1
,
cap
);
ret
=
taosMemoryCalloc
(
1
,
cap
+
46
);
ret
=
POINTER_SHIFT
(
ret
,
46
);
ret
->
header
.
vgId
=
vgId
;
ret
->
version
=
htonl
(
1
);
ret
->
version
=
htonl
(
1
);
ret
->
length
=
htonl
(
cap
-
sizeof
(
SSubmitReq
)
);
ret
->
length
=
sizeof
(
SSubmitReq
);
ret
->
numOfBlocks
=
htonl
(
sz
);
ret
->
numOfBlocks
=
htonl
(
sz
);
void
*
submitBlk
=
POINTER_SHIFT
(
ret
,
sizeof
(
SSubmitReq
));
void
*
submitBlk
=
POINTER_SHIFT
(
ret
,
sizeof
(
SSubmitReq
));
...
@@ -1703,11 +1706,14 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
...
@@ -1703,11 +1706,14 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
blkHead
->
dataLen
+=
rowLen
;
blkHead
->
dataLen
+=
rowLen
;
}
}
int32_t
len
=
blkHead
->
dataLen
;
int32_t
dataLen
=
blkHead
->
dataLen
;
blkHead
->
dataLen
=
htonl
(
len
);
blkHead
->
dataLen
=
htonl
(
dataLen
);
blkHead
=
POINTER_SHIFT
(
blkHead
,
len
);
ret
->
length
+=
sizeof
(
SSubmitBlk
)
+
schemaLen
+
dataLen
;
blkHead
=
POINTER_SHIFT
(
blkHead
,
schemaLen
+
dataLen
);
/*submitBlk = blkHead;*/
/*submitBlk = blkHead;*/
}
}
ret
->
length
=
htonl
(
ret
->
length
);
return
ret
;
return
ret
;
}
}
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
浏览文件 @
d17b478e
...
@@ -106,6 +106,7 @@ int32_t vmAllocQueue(SVnodesMgmt *pMgmt, SVnodeObj *pVnode);
...
@@ -106,6 +106,7 @@ int32_t vmAllocQueue(SVnodesMgmt *pMgmt, SVnodeObj *pVnode);
void
vmFreeQueue
(
SVnodesMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
);
void
vmFreeQueue
(
SVnodesMgmt
*
pMgmt
,
SVnodeObj
*
pVnode
);
int32_t
vmPutMsgToSyncQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
// sync integration
int32_t
vmPutMsgToSyncQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
// sync integration
int32_t
vmPutMsgToWriteQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
int32_t
vmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
vmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
vmPutMsgToFetchQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
vmPutMsgToFetchQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
vmPutMsgToApplyQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
int32_t
vmPutMsgToApplyQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
d17b478e
...
@@ -177,6 +177,7 @@ int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pMsg) {
...
@@ -177,6 +177,7 @@ int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pMsg) {
SMsgCb
msgCb
=
pMgmt
->
pDnode
->
data
.
msgCb
;
SMsgCb
msgCb
=
pMgmt
->
pDnode
->
data
.
msgCb
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
vmPutMsgToWriteQueue
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
vmPutMsgToQueryQueue
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
vmPutMsgToQueryQueue
;
msgCb
.
queueFps
[
FETCH_QUEUE
]
=
vmPutMsgToFetchQueue
;
msgCb
.
queueFps
[
FETCH_QUEUE
]
=
vmPutMsgToFetchQueue
;
msgCb
.
queueFps
[
APPLY_QUEUE
]
=
vmPutMsgToApplyQueue
;
msgCb
.
queueFps
[
APPLY_QUEUE
]
=
vmPutMsgToApplyQueue
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
d17b478e
...
@@ -135,6 +135,7 @@ static void *vmOpenVnodeFunc(void *param) {
...
@@ -135,6 +135,7 @@ static void *vmOpenVnodeFunc(void *param) {
SMsgCb
msgCb
=
pMgmt
->
pDnode
->
data
.
msgCb
;
SMsgCb
msgCb
=
pMgmt
->
pDnode
->
data
.
msgCb
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
vmPutMsgToWriteQueue
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
vmPutMsgToQueryQueue
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
vmPutMsgToQueryQueue
;
msgCb
.
queueFps
[
FETCH_QUEUE
]
=
vmPutMsgToFetchQueue
;
msgCb
.
queueFps
[
FETCH_QUEUE
]
=
vmPutMsgToFetchQueue
;
msgCb
.
queueFps
[
APPLY_QUEUE
]
=
vmPutMsgToApplyQueue
;
msgCb
.
queueFps
[
APPLY_QUEUE
]
=
vmPutMsgToApplyQueue
;
...
@@ -147,7 +148,7 @@ static void *vmOpenVnodeFunc(void *param) {
...
@@ -147,7 +148,7 @@ static void *vmOpenVnodeFunc(void *param) {
pThread
->
failed
++
;
pThread
->
failed
++
;
}
else
{
}
else
{
vmOpenVnode
(
pMgmt
,
pCfg
,
pImpl
);
vmOpenVnode
(
pMgmt
,
pCfg
,
pImpl
);
//vnodeStart(pImpl);
//
vnodeStart(pImpl);
dDebug
(
"vgId:%d, is opened by thread:%d"
,
pCfg
->
vgId
,
pThread
->
threadIndex
);
dDebug
(
"vgId:%d, is opened by thread:%d"
,
pCfg
->
vgId
,
pThread
->
threadIndex
);
pThread
->
opened
++
;
pThread
->
opened
++
;
}
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
d17b478e
...
@@ -357,6 +357,10 @@ static int32_t vmPutRpcMsgToQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc, EQueueT
...
@@ -357,6 +357,10 @@ static int32_t vmPutRpcMsgToQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc, EQueueT
pMsg
->
rpcMsg
=
*
pRpc
;
pMsg
->
rpcMsg
=
*
pRpc
;
// if (pMsg->rpcMsg.handle != NULL) assert(pMsg->rpcMsg.refId != 0);
// if (pMsg->rpcMsg.handle != NULL) assert(pMsg->rpcMsg.refId != 0);
switch
(
qtype
)
{
switch
(
qtype
)
{
case
WRITE_QUEUE
:
dTrace
(
"msg:%p, will be put into vnode-write queue"
,
pMsg
);
taosWriteQitem
(
pVnode
->
pWriteQ
,
pMsg
);
break
;
case
QUERY_QUEUE
:
case
QUERY_QUEUE
:
dTrace
(
"msg:%p, will be put into vnode-query queue"
,
pMsg
);
dTrace
(
"msg:%p, will be put into vnode-query queue"
,
pMsg
);
taosWriteQitem
(
pVnode
->
pQueryQ
,
pMsg
);
taosWriteQitem
(
pVnode
->
pQueryQ
,
pMsg
);
...
@@ -387,6 +391,10 @@ static int32_t vmPutRpcMsgToQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc, EQueueT
...
@@ -387,6 +391,10 @@ static int32_t vmPutRpcMsgToQueue(SMgmtWrapper *pWrapper, SRpcMsg *pRpc, EQueueT
return
code
;
return
code
;
}
}
int32_t
vmPutMsgToWriteQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
return
vmPutRpcMsgToQueue
(
pWrapper
,
pRpc
,
WRITE_QUEUE
);
}
int32_t
vmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
int32_t
vmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
return
vmPutRpcMsgToQueue
(
pWrapper
,
pRpc
,
QUERY_QUEUE
);
return
vmPutRpcMsgToQueue
(
pWrapper
,
pRpc
,
QUERY_QUEUE
);
}
}
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
d17b478e
...
@@ -884,11 +884,21 @@ int32_t tqProcessVgChangeReq(STQ* pTq, char* msg, int32_t msgLen) {
...
@@ -884,11 +884,21 @@ int32_t tqProcessVgChangeReq(STQ* pTq, char* msg, int32_t msgLen) {
}
}
}
}
void
tqTableSink
(
void
*
vnode
,
int64_t
ver
,
const
SArray
*
data
)
{
void
tqTableSink
(
SStreamTask
*
pTask
,
void
*
vnode
,
int64_t
ver
,
void
*
data
)
{
//
const
SArray
*
pRes
=
(
const
SArray
*
)
data
;
SVnode
*
pVnode
=
(
SVnode
*
)
vnode
;
SVnode
*
pVnode
=
(
SVnode
*
)
vnode
;
ASSERT
(
pTask
->
tbSink
.
pTSchema
);
SSubmitReq
*
pReq
=
tdBlockToSubmit
(
pRes
,
pTask
->
tbSink
.
pTSchema
,
true
,
pTask
->
tbSink
.
stbUid
,
pVnode
->
config
.
vgId
);
tPrintFixedSchemaSubmitReq
(
pReq
,
pTask
->
tbSink
.
pTSchema
);
// build write msg
// build write msg
//
SRpcMsg
msg
=
{
.
msgType
=
TDMT_VND_SUBMIT
,
.
pCont
=
pReq
,
.
contLen
=
ntohl
(
pReq
->
length
),
};
ASSERT
(
tmsgPutToQueue
(
&
pVnode
->
msgCb
,
WRITE_QUEUE
,
&
msg
)
==
0
);
}
}
int32_t
tqExpandTask
(
STQ
*
pTq
,
SStreamTask
*
pTask
,
int32_t
parallel
)
{
int32_t
tqExpandTask
(
STQ
*
pTq
,
SStreamTask
*
pTask
,
int32_t
parallel
)
{
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
d17b478e
#include "ttime.h"
#include "tdatablock.h"
#include "executorimpl.h"
#include "executorimpl.h"
#include "functionMgt.h"
#include "functionMgt.h"
#include "tdatablock.h"
#include "ttime.h"
typedef
enum
SResultTsInterpType
{
typedef
enum
SResultTsInterpType
{
RESULT_ROW_START_INTERP
=
1
,
RESULT_ROW_START_INTERP
=
1
,
...
@@ -545,7 +545,6 @@ static void setResultRowInterpo(SResultRow* pResult, SResultTsInterpType type) {
...
@@ -545,7 +545,6 @@ static void setResultRowInterpo(SResultRow* pResult, SResultTsInterpType type) {
}
}
}
}
static
void
doWindowBorderInterpolation
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pBlock
,
SqlFunctionCtx
*
pCtx
,
static
void
doWindowBorderInterpolation
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pBlock
,
SqlFunctionCtx
*
pCtx
,
SResultRow
*
pResult
,
STimeWindow
*
win
,
int32_t
startPos
,
int32_t
forwardStep
,
SResultRow
*
pResult
,
STimeWindow
*
win
,
int32_t
startPos
,
int32_t
forwardStep
,
int32_t
order
,
bool
timeWindowInterpo
)
{
int32_t
order
,
bool
timeWindowInterpo
)
{
...
@@ -981,10 +980,10 @@ static void finalizeUpdatedResult(int32_t numOfOutput, SDiskbasedBuf* pBuf, SArr
...
@@ -981,10 +980,10 @@ static void finalizeUpdatedResult(int32_t numOfOutput, SDiskbasedBuf* pBuf, SArr
}
}
}
}
static
void
setInverFunction
(
SqlFunctionCtx
*
pCtx
,
int32_t
num
,
EStreamType
type
)
{
static
void
setInverFunction
(
SqlFunctionCtx
*
pCtx
,
int32_t
num
,
EStreamType
type
)
{
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
if
(
type
==
STREAM_INVERT
)
{
if
(
type
==
STREAM_INVERT
)
{
fmSetInvertFunc
(
pCtx
[
i
].
functionId
,
&
(
pCtx
[
i
].
fpSet
));
fmSetInvertFunc
(
pCtx
[
i
].
functionId
,
&
(
pCtx
[
i
].
fpSet
));
}
else
if
(
type
==
STREAM_NORMAL
){
}
else
if
(
type
==
STREAM_NORMAL
)
{
fmSetNormalFunc
(
pCtx
[
i
].
functionId
,
&
(
pCtx
[
i
].
fpSet
));
fmSetNormalFunc
(
pCtx
[
i
].
functionId
,
&
(
pCtx
[
i
].
fpSet
));
}
}
}
}
...
@@ -1038,7 +1037,8 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -1038,7 +1037,8 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
blockDataEnsureCapacity
(
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
);
doBuildResultDatablock
(
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pOperator
->
pExpr
,
pInfo
->
aggSup
.
pResultBuf
);
doBuildResultDatablock
(
&
pInfo
->
binfo
,
&
pInfo
->
groupResInfo
,
pOperator
->
pExpr
,
pInfo
->
aggSup
.
pResultBuf
);
ASSERT
(
pInfo
->
binfo
.
pRes
->
info
.
rows
>
0
);
// TODO: remove for stream
/*ASSERT(pInfo->binfo.pRes->info.rows > 0);*/
pOperator
->
status
=
OP_RES_TO_RETURN
;
pOperator
->
status
=
OP_RES_TO_RETURN
;
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
return
pInfo
->
binfo
.
pRes
->
info
.
rows
==
0
?
NULL
:
pInfo
->
binfo
.
pRes
;
...
@@ -1118,7 +1118,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SExprInfo*
...
@@ -1118,7 +1118,7 @@ SOperatorInfo* createIntervalOperatorInfo(SOperatorInfo* downstream, SExprInfo*
return
pOperator
;
return
pOperator
;
_error:
_error:
destroyIntervalOperatorInfo
(
pInfo
,
numOfCols
);
destroyIntervalOperatorInfo
(
pInfo
,
numOfCols
);
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
taosMemoryFreeClear
(
pOperator
);
...
@@ -1177,7 +1177,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SExpr
...
@@ -1177,7 +1177,7 @@ SOperatorInfo* createStreamIntervalOperatorInfo(SOperatorInfo* downstream, SExpr
return
pOperator
;
return
pOperator
;
_error:
_error:
destroyIntervalOperatorInfo
(
pInfo
,
numOfCols
);
destroyIntervalOperatorInfo
(
pInfo
,
numOfCols
);
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pInfo
);
taosMemoryFreeClear
(
pOperator
);
taosMemoryFreeClear
(
pOperator
);
...
@@ -1379,7 +1379,7 @@ SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SExprInfo*
...
@@ -1379,7 +1379,7 @@ SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SExprInfo*
int32_t
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
int32_t
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
return
pOperator
;
return
pOperator
;
_error:
_error:
taosMemoryFree
(
pInfo
);
taosMemoryFree
(
pInfo
);
taosMemoryFree
(
pOperator
);
taosMemoryFree
(
pOperator
);
pTaskInfo
->
code
=
TSDB_CODE_OUT_OF_MEMORY
;
pTaskInfo
->
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -1421,7 +1421,7 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SExprInf
...
@@ -1421,7 +1421,7 @@ SOperatorInfo* createStatewindowOperatorInfo(SOperatorInfo* downstream, SExprInf
int32_t
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
int32_t
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
return
pOperator
;
return
pOperator
;
_error:
_error:
pTaskInfo
->
code
=
TSDB_CODE_SUCCESS
;
pTaskInfo
->
code
=
TSDB_CODE_SUCCESS
;
return
NULL
;
return
NULL
;
}
}
...
@@ -1432,8 +1432,8 @@ void destroySWindowOperatorInfo(void* param, int32_t numOfOutput) {
...
@@ -1432,8 +1432,8 @@ void destroySWindowOperatorInfo(void* param, int32_t numOfOutput) {
}
}
SOperatorInfo
*
createSessionAggOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SOperatorInfo
*
createSessionAggOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResBlock
,
int64_t
gap
,
int32_t
tsSlotId
,
STimeWindowAggSupp
*
pTwAggSupp
,
SSDataBlock
*
pResBlock
,
int64_t
gap
,
int32_t
tsSlotId
,
SExecTaskInfo
*
pTaskInfo
)
{
S
TimeWindowAggSupp
*
pTwAggSupp
,
S
ExecTaskInfo
*
pTaskInfo
)
{
SSessionAggOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SSessionAggOperatorInfo
));
SSessionAggOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SSessionAggOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
if
(
pInfo
==
NULL
||
pOperator
==
NULL
)
{
...
@@ -1473,7 +1473,7 @@ SOperatorInfo* createSessionAggOperatorInfo(SOperatorInfo* downstream, SExprInfo
...
@@ -1473,7 +1473,7 @@ SOperatorInfo* createSessionAggOperatorInfo(SOperatorInfo* downstream, SExprInfo
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
return
pOperator
;
return
pOperator
;
_error:
_error:
if
(
pInfo
!=
NULL
)
{
if
(
pInfo
!=
NULL
)
{
destroySWindowOperatorInfo
(
pInfo
,
numOfCols
);
destroySWindowOperatorInfo
(
pInfo
,
numOfCols
);
}
}
...
...
source/libs/stream/src/tstream.c
浏览文件 @
d17b478e
...
@@ -150,12 +150,12 @@ int32_t streamExecTask(SStreamTask* pTask, SMsgCb* pMsgCb, const void* input, in
...
@@ -150,12 +150,12 @@ int32_t streamExecTask(SStreamTask* pTask, SMsgCb* pMsgCb, const void* input, in
pRes
=
(
SArray
*
)
input
;
pRes
=
(
SArray
*
)
input
;
}
}
if
(
pRes
==
NULL
||
taosArrayGetSize
(
pRes
)
==
0
)
return
0
;
// sink
// sink
if
(
pTask
->
sinkType
==
TASK_SINK__TABLE
)
{
if
(
pTask
->
sinkType
==
TASK_SINK__TABLE
)
{
/*blockDebugShowData(pRes);*/
/*blockDebugShowData(pRes);*/
ASSERT
(
pTask
->
tbSink
.
pTSchema
);
pTask
->
tbSink
.
tbSinkFunc
(
pTask
,
pTask
->
tbSink
.
vnode
,
0
,
pRes
);
SSubmitReq
*
pReq
=
tdBlockToSubmit
(
pRes
,
pTask
->
tbSink
.
pTSchema
,
false
,
pTask
->
tbSink
.
stbUid
);
tPrintFixedSchemaSubmitReq
(
pReq
,
pTask
->
tbSink
.
pTSchema
);
}
else
if
(
pTask
->
sinkType
==
TASK_SINK__SMA
)
{
}
else
if
(
pTask
->
sinkType
==
TASK_SINK__SMA
)
{
pTask
->
smaSink
.
smaSink
(
pTask
->
ahandle
,
pTask
->
smaSink
.
smaId
,
pRes
);
pTask
->
smaSink
.
smaSink
(
pTask
->
ahandle
,
pTask
->
smaSink
.
smaId
,
pRes
);
//
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录