Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
98e2fa2d
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看板
提交
98e2fa2d
编写于
2月 08, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add ignore update option for create stream
上级
bafe5a57
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
26 addition
and
1 deletion
+26
-1
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+2
-0
include/libs/planner/planner.h
include/libs/planner/planner.h
+1
-0
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-0
source/dnode/mnode/impl/src/mndDef.c
source/dnode/mnode/impl/src/mndDef.c
+3
-1
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+2
-0
source/libs/nodes/src/nodesCloneFuncs.c
source/libs/nodes/src/nodesCloneFuncs.c
+1
-0
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+7
-0
source/libs/nodes/src/nodesMsgFuncs.c
source/libs/nodes/src/nodesMsgFuncs.c
+6
-0
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+1
-0
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+1
-0
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+1
-0
未找到文件。
include/libs/nodes/plannodes.h
浏览文件 @
98e2fa2d
...
...
@@ -93,6 +93,7 @@ typedef struct SScanLogicNode {
int64_t
watermark
;
int64_t
deleteMark
;
int8_t
igExpired
;
int8_t
igCheckUpdate
;
SArray
*
pSmaIndexes
;
SNodeList
*
pGroupTags
;
bool
groupSort
;
...
...
@@ -217,6 +218,7 @@ typedef struct SWindowLogicNode {
int64_t
watermark
;
int64_t
deleteMark
;
int8_t
igExpired
;
int8_t
igCheckUpdate
;
EWindowAlgorithm
windowAlgo
;
EOrder
inputTsOrder
;
EOrder
outputTsOrder
;
...
...
include/libs/planner/planner.h
浏览文件 @
98e2fa2d
...
...
@@ -36,6 +36,7 @@ typedef struct SPlanContext {
int64_t
watermark
;
int64_t
deleteMark
;
int8_t
igExpired
;
int8_t
igCheckUpdate
;
char
*
pMsg
;
int32_t
msgLen
;
const
char
*
pUser
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
98e2fa2d
...
...
@@ -648,6 +648,7 @@ typedef struct {
int64_t
checkpointFreq
;
// ms
int64_t
currentTick
;
// do not serialize
int64_t
deleteMark
;
int8_t
igCheckUpdate
;
}
SStreamObj
;
int32_t
tEncodeSStreamObj
(
SEncoder
*
pEncoder
,
const
SStreamObj
*
pObj
);
...
...
source/dnode/mnode/impl/src/mndDef.c
浏览文件 @
98e2fa2d
...
...
@@ -78,6 +78,7 @@ int32_t tEncodeSStreamObj(SEncoder *pEncoder, const SStreamObj *pObj) {
// 3.0.20
if
(
tEncodeI64
(
pEncoder
,
pObj
->
checkpointFreq
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
pEncoder
,
pObj
->
igCheckUpdate
)
<
0
)
return
-
1
;
tEndEncode
(
pEncoder
);
return
pEncoder
->
pos
;
...
...
@@ -145,6 +146,7 @@ int32_t tDecodeSStreamObj(SDecoder *pDecoder, SStreamObj *pObj, int32_t sver) {
// 3.0.20
if
(
sver
>=
2
)
{
if
(
tDecodeI64
(
pDecoder
,
&
pObj
->
checkpointFreq
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pObj
->
igCheckUpdate
)
<
0
)
return
-
1
;
}
tEndDecode
(
pDecoder
);
return
0
;
...
...
@@ -489,7 +491,7 @@ int32_t tEncodeSubscribeObj(void **buf, const SMqSubscribeObj *pSub) {
tlen
+=
tEncodeSMqConsumerEp
(
buf
,
pConsumerEp
);
cnt
++
;
}
if
(
cnt
!=
sz
)
return
-
1
;
if
(
cnt
!=
sz
)
return
-
1
;
tlen
+=
taosEncodeArray
(
buf
,
pSub
->
unassignedVgs
,
(
FEncode
)
tEncodeSMqVgEp
);
tlen
+=
taosEncodeString
(
buf
,
pSub
->
dbName
);
return
tlen
;
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
98e2fa2d
...
...
@@ -297,6 +297,7 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
pObj
->
triggerParam
=
pCreate
->
maxDelay
;
pObj
->
watermark
=
pCreate
->
watermark
;
pObj
->
fillHistory
=
pCreate
->
fillHistory
;
pObj
->
igCheckUpdate
=
pCreate
->
igUpdate
;
memcpy
(
pObj
->
sourceDb
,
pCreate
->
sourceDB
,
TSDB_DB_FNAME_LEN
);
SDbObj
*
pSourceDb
=
mndAcquireDb
(
pMnode
,
pCreate
->
sourceDB
);
...
...
@@ -345,6 +346,7 @@ static int32_t mndBuildStreamObjFromCreateReq(SMnode *pMnode, SStreamObj *pObj,
.
triggerType
=
pObj
->
trigger
==
STREAM_TRIGGER_MAX_DELAY
?
STREAM_TRIGGER_WINDOW_CLOSE
:
pObj
->
trigger
,
.
watermark
=
pObj
->
watermark
,
.
igExpired
=
pObj
->
igExpired
,
.
igCheckUpdate
=
pObj
->
igCheckUpdate
,
};
// using ast and param to build physical plan
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
98e2fa2d
...
...
@@ -467,6 +467,7 @@ static int32_t logicWindowCopy(const SWindowLogicNode* pSrc, SWindowLogicNode* p
COPY_SCALAR_FIELD
(
watermark
);
COPY_SCALAR_FIELD
(
deleteMark
);
COPY_SCALAR_FIELD
(
igExpired
);
COPY_SCALAR_FIELD
(
igCheckUpdate
);
COPY_SCALAR_FIELD
(
windowAlgo
);
COPY_SCALAR_FIELD
(
inputTsOrder
);
COPY_SCALAR_FIELD
(
outputTsOrder
);
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
98e2fa2d
...
...
@@ -1553,6 +1553,7 @@ static const char* jkTableScanPhysiPlanGroupSort = "GroupSort";
static
const
char
*
jkTableScanPhysiPlanTags
=
"Tags"
;
static
const
char
*
jkTableScanPhysiPlanSubtable
=
"Subtable"
;
static
const
char
*
jkTableScanPhysiPlanAssignBlockUid
=
"AssignBlockUid"
;
static
const
char
*
jkTableScanPhysiPlanIgnoreUpdate
=
"IgnoreUpdate"
;
static
int32_t
physiTableScanNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
STableScanPhysiNode
*
pNode
=
(
const
STableScanPhysiNode
*
)
pObj
;
...
...
@@ -1618,6 +1619,9 @@ static int32_t physiTableScanNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddBoolToObject
(
pJson
,
jkTableScanPhysiPlanAssignBlockUid
,
pNode
->
assignBlockUid
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkTableScanPhysiPlanIgnoreUpdate
,
pNode
->
igCheckUpdate
);
}
return
code
;
}
...
...
@@ -1686,6 +1690,9 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkTableScanPhysiPlanAssignBlockUid
,
&
pNode
->
assignBlockUid
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetTinyIntValue
(
pJson
,
jkTableScanPhysiPlanIgnoreUpdate
,
&
pNode
->
igCheckUpdate
);
}
return
code
;
}
...
...
source/libs/nodes/src/nodesMsgFuncs.c
浏览文件 @
98e2fa2d
...
...
@@ -2078,6 +2078,9 @@ static int32_t physiTableScanNodeInlineToMsg(const void* pObj, STlvEncoder* pEnc
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvEncodeValueBool
(
pEncoder
,
pNode
->
assignBlockUid
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvEncodeValueI8
(
pEncoder
,
pNode
->
igCheckUpdate
);
}
return
code
;
}
...
...
@@ -2154,6 +2157,9 @@ static int32_t msgToPhysiTableScanNodeInline(STlvDecoder* pDecoder, void* pObj)
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvDecodeValueBool
(
pDecoder
,
&
pNode
->
assignBlockUid
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvDecodeValueI8
(
pDecoder
,
&
pNode
->
igCheckUpdate
);
}
return
code
;
}
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
98e2fa2d
...
...
@@ -705,6 +705,7 @@ static int32_t createWindowLogicNodeFinalize(SLogicPlanContext* pCxt, SSelectStm
pWindow
->
watermark
=
pCxt
->
pPlanCxt
->
watermark
;
pWindow
->
deleteMark
=
pCxt
->
pPlanCxt
->
deleteMark
;
pWindow
->
igExpired
=
pCxt
->
pPlanCxt
->
igExpired
;
pWindow
->
igCheckUpdate
=
pCxt
->
pPlanCxt
->
igCheckUpdate
;
}
pWindow
->
inputTsOrder
=
ORDER_ASC
;
pWindow
->
outputTsOrder
=
ORDER_ASC
;
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
98e2fa2d
...
...
@@ -332,6 +332,7 @@ static void scanPathOptSetScanWin(SScanLogicNode* pScan) {
pScan
->
watermark
=
((
SWindowLogicNode
*
)
pParent
)
->
watermark
;
pScan
->
deleteMark
=
((
SWindowLogicNode
*
)
pParent
)
->
deleteMark
;
pScan
->
igExpired
=
((
SWindowLogicNode
*
)
pParent
)
->
igExpired
;
pScan
->
igCheckUpdate
=
((
SWindowLogicNode
*
)
pParent
)
->
igCheckUpdate
;
}
}
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
98e2fa2d
...
...
@@ -582,6 +582,7 @@ static int32_t createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubp
pTableScan
->
triggerType
=
pScanLogicNode
->
triggerType
;
pTableScan
->
watermark
=
pScanLogicNode
->
watermark
;
pTableScan
->
igExpired
=
pScanLogicNode
->
igExpired
;
pTableScan
->
igCheckUpdate
=
pScanLogicNode
->
igCheckUpdate
;
pTableScan
->
assignBlockUid
=
pCxt
->
pPlanCxt
->
rSmaQuery
?
true
:
false
;
int32_t
code
=
createScanPhysiNodeFinalize
(
pCxt
,
pSubplan
,
pScanLogicNode
,
(
SScanPhysiNode
*
)
pTableScan
,
pPhyNode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录