Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4734795f
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4734795f
编写于
12月 28, 2022
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stream):stream insert data into an existing table
上级
fb628f7f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
1 deletion
+9
-1
include/common/tmsg.h
include/common/tmsg.h
+4
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-0
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+1
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+2
-0
未找到文件。
include/common/tmsg.h
浏览文件 @
4734795f
...
@@ -1751,6 +1751,8 @@ typedef struct {
...
@@ -1751,6 +1751,8 @@ typedef struct {
#define STREAM_FILL_HISTORY_ON 1
#define STREAM_FILL_HISTORY_ON 1
#define STREAM_FILL_HISTORY_OFF 0
#define STREAM_FILL_HISTORY_OFF 0
#define STREAM_DEFAULT_FILL_HISTORY STREAM_FILL_HISTORY_OFF
#define STREAM_DEFAULT_FILL_HISTORY STREAM_FILL_HISTORY_OFF
#define STREAM_CREATE_STABLE_TRUE 1
#define STREAM_CREATE_STABLE_FALSE 0
typedef
struct
{
typedef
struct
{
char
name
[
TSDB_STREAM_FNAME_LEN
];
char
name
[
TSDB_STREAM_FNAME_LEN
];
...
@@ -1768,6 +1770,8 @@ typedef struct {
...
@@ -1768,6 +1770,8 @@ typedef struct {
SArray
*
pTags
;
// array of SField
SArray
*
pTags
;
// array of SField
// 3.0.20
// 3.0.20
int64_t
checkpointFreq
;
// ms
int64_t
checkpointFreq
;
// ms
// 3.0.2.3
int8_t
createStb
;
}
SCMCreateStreamReq
;
}
SCMCreateStreamReq
;
typedef
struct
{
typedef
struct
{
...
...
source/common/src/tmsg.c
浏览文件 @
4734795f
...
@@ -5424,6 +5424,7 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS
...
@@ -5424,6 +5424,7 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS
if
(
tEncodeI32
(
&
encoder
,
pField
->
bytes
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pField
->
bytes
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pField
->
name
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pField
->
name
)
<
0
)
return
-
1
;
}
}
if
(
tEncodeI8
(
&
encoder
,
pReq
->
createStb
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
tEndEncode
(
&
encoder
);
...
@@ -5484,6 +5485,7 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea
...
@@ -5484,6 +5485,7 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea
}
}
}
}
}
}
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
createStb
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
tEndDecode
(
&
decoder
);
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
4734795f
...
@@ -637,7 +637,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
...
@@ -637,7 +637,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
if
(
mndTrancCheckConflict
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndTrancCheckConflict
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
// create stb for stream
// create stb for stream
if
(
mndCreateStbForStream
(
pMnode
,
pTrans
,
&
streamObj
,
pReq
->
info
.
conn
.
user
)
<
0
)
{
if
(
createStreamReq
.
createStb
==
STREAM_CREATE_STABLE_TRUE
&&
mndCreateStbForStream
(
pMnode
,
pTrans
,
&
streamObj
,
pReq
->
info
.
conn
.
user
)
<
0
)
{
mError
(
"trans:%d, failed to create stb for stream %s since %s"
,
pTrans
->
id
,
createStreamReq
.
name
,
terrstr
());
mError
(
"trans:%d, failed to create stb for stream %s since %s"
,
pTrans
->
id
,
createStreamReq
.
name
,
terrstr
());
mndTransDrop
(
pTrans
);
mndTransDrop
(
pTrans
);
goto
_OVER
;
goto
_OVER
;
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
4734795f
...
@@ -5766,6 +5766,8 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt*
...
@@ -5766,6 +5766,8 @@ static int32_t buildCreateStreamReq(STranslateContext* pCxt, SCreateStreamStmt*
pReq
->
numOfTags
=
LIST_LENGTH
(
pStmt
->
pTags
);
pReq
->
numOfTags
=
LIST_LENGTH
(
pStmt
->
pTags
);
}
}
pReq
->
createStb
=
STREAM_CREATE_STABLE_TRUE
;
return
code
;
return
code
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录