Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8b6a50d9
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看板
提交
8b6a50d9
编写于
2月 07, 2023
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add explain test case
上级
571e936b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
18 deletion
+38
-18
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+1
-0
source/libs/executor/src/dataInserter.c
source/libs/executor/src/dataInserter.c
+20
-16
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+8
-1
source/libs/nodes/src/nodesMsgFuncs.c
source/libs/nodes/src/nodesMsgFuncs.c
+8
-1
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+1
-0
未找到文件。
include/libs/nodes/plannodes.h
浏览文件 @
8b6a50d9
...
...
@@ -562,6 +562,7 @@ typedef struct SQueryInserterNode {
char
tableName
[
TSDB_TABLE_NAME_LEN
];
int32_t
vgId
;
SEpSet
epSet
;
bool
explain
;
}
SQueryInserterNode
;
typedef
struct
SDataDeleterNode
{
...
...
source/libs/executor/src/dataInserter.c
浏览文件 @
8b6a50d9
...
...
@@ -46,6 +46,7 @@ typedef struct SDataInserterHandle {
uint64_t
cachedSize
;
TdThreadMutex
mutex
;
tsem_t
ready
;
bool
explain
;
}
SDataInserterHandle
;
typedef
struct
SSubmitRspParam
{
...
...
@@ -333,26 +334,28 @@ int32_t dataBlocksToSubmitReq(SDataInserterHandle* pInserter, void** pMsg, int32
static
int32_t
putDataBlock
(
SDataSinkHandle
*
pHandle
,
const
SInputData
*
pInput
,
bool
*
pContinue
)
{
SDataInserterHandle
*
pInserter
=
(
SDataInserterHandle
*
)
pHandle
;
taosArrayPush
(
pInserter
->
pDataBlocks
,
&
pInput
->
pData
);
void
*
pMsg
=
NULL
;
int32_t
msgLen
=
0
;
int32_t
code
=
dataBlocksToSubmitReq
(
pInserter
,
&
pMsg
,
&
msgLen
);
if
(
code
)
{
return
code
;
}
if
(
!
pInserter
->
explain
)
{
taosArrayPush
(
pInserter
->
pDataBlocks
,
&
pInput
->
pData
);
void
*
pMsg
=
NULL
;
int32_t
msgLen
=
0
;
int32_t
code
=
dataBlocksToSubmitReq
(
pInserter
,
&
pMsg
,
&
msgLen
);
if
(
code
)
{
return
code
;
}
taosArrayClear
(
pInserter
->
pDataBlocks
);
taosArrayClear
(
pInserter
->
pDataBlocks
);
code
=
sendSubmitRequest
(
pInserter
,
pMsg
,
msgLen
,
pInserter
->
pParam
->
readHandle
->
pMsgCb
->
clientRpc
,
&
pInserter
->
pNode
->
epSet
);
if
(
code
)
{
return
code
;
}
code
=
sendSubmitRequest
(
pInserter
,
pMsg
,
msgLen
,
pInserter
->
pParam
->
readHandle
->
pMsgCb
->
clientRpc
,
&
pInserter
->
pNode
->
epSet
);
if
(
code
)
{
return
code
;
}
tsem_wait
(
&
pInserter
->
ready
);
tsem_wait
(
&
pInserter
->
ready
);
if
(
pInserter
->
submitRes
.
code
)
{
return
pInserter
->
submitRes
.
code
;
if
(
pInserter
->
submitRes
.
code
)
{
return
pInserter
->
submitRes
.
code
;
}
}
*
pContinue
=
true
;
...
...
@@ -412,6 +415,7 @@ int32_t createDataInserter(SDataSinkManager* pManager, const SDataSinkNode* pDat
inserter
->
pParam
=
pParam
;
inserter
->
status
=
DS_BUF_EMPTY
;
inserter
->
queryEnd
=
false
;
inserter
->
explain
=
pInserterNode
->
explain
;
int64_t
suid
=
0
;
int32_t
code
=
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
8b6a50d9
...
...
@@ -176,7 +176,7 @@ const char* nodesNodeName(ENodeType type) {
case
QUERY_NODE_SHOW_DB_ALIVE_STMT
:
return
"ShowDbAliveStmt"
;
case
QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT
:
return
"ShowClusterAliveStmt"
;
return
"ShowClusterAliveStmt"
;
case
QUERY_NODE_REDISTRIBUTE_VGROUP_STMT
:
return
"RedistributeVgroupStmt"
;
case
QUERY_NODE_SPLIT_VGROUP_STMT
:
...
...
@@ -2595,6 +2595,7 @@ static const char* jkQueryInsertPhysiPlanTableType = "TableType";
static
const
char
*
jkQueryInsertPhysiPlanTableFName
=
"TableFName"
;
static
const
char
*
jkQueryInsertPhysiPlanVgId
=
"VgId"
;
static
const
char
*
jkQueryInsertPhysiPlanEpSet
=
"EpSet"
;
static
const
char
*
jkQueryInsertPhysiPlanExplain
=
"Explain"
;
static
int32_t
physiQueryInsertNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SQueryInserterNode
*
pNode
=
(
const
SQueryInserterNode
*
)
pObj
;
...
...
@@ -2621,6 +2622,9 @@ static int32_t physiQueryInsertNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddObject
(
pJson
,
jkQueryInsertPhysiPlanEpSet
,
epSetToJson
,
&
pNode
->
epSet
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddBoolToObject
(
pJson
,
jkQueryInsertPhysiPlanExplain
,
pNode
->
explain
);
}
return
code
;
}
...
...
@@ -2650,6 +2654,9 @@ static int32_t jsonToPhysiQueryInsertNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonToObject
(
pJson
,
jkQueryInsertPhysiPlanEpSet
,
jsonToEpSet
,
&
pNode
->
epSet
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkQueryInsertPhysiPlanExplain
,
&
pNode
->
explain
);
}
return
code
;
}
...
...
source/libs/nodes/src/nodesMsgFuncs.c
浏览文件 @
8b6a50d9
...
...
@@ -3244,7 +3244,8 @@ enum {
PHY_QUERY_INSERT_CODE_TABLE_TYPE
,
PHY_QUERY_INSERT_CODE_TABLE_NAME
,
PHY_QUERY_INSERT_CODE_VG_ID
,
PHY_QUERY_INSERT_CODE_EP_SET
PHY_QUERY_INSERT_CODE_EP_SET
,
PHY_QUERY_INSERT_CODE_EXPLAIN
};
static
int32_t
physiQueryInsertNodeToMsg
(
const
void
*
pObj
,
STlvEncoder
*
pEncoder
)
{
...
...
@@ -3272,6 +3273,9 @@ static int32_t physiQueryInsertNodeToMsg(const void* pObj, STlvEncoder* pEncoder
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvEncodeObj
(
pEncoder
,
PHY_QUERY_INSERT_CODE_EP_SET
,
epSetToMsg
,
&
pNode
->
epSet
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvEncodeBool
(
pEncoder
,
PHY_QUERY_INSERT_CODE_EXPLAIN
,
pNode
->
explain
);
}
return
code
;
}
...
...
@@ -3307,6 +3311,9 @@ static int32_t msgToPhysiQueryInsertNode(STlvDecoder* pDecoder, void* pObj) {
case
PHY_QUERY_INSERT_CODE_EP_SET
:
code
=
tlvDecodeObjFromTlv
(
pTlv
,
msgToEpSet
,
&
pNode
->
epSet
);
break
;
case
PHY_QUERY_INSERT_CODE_EXPLAIN
:
code
=
tlvDecodeBool
(
pTlv
,
&
pNode
->
explain
);
break
;
default:
break
;
}
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
8b6a50d9
...
...
@@ -1718,6 +1718,7 @@ static int32_t createQueryInserter(SPhysiPlanContext* pCxt, SVnodeModifyLogicNod
strcpy
(
pInserter
->
tableName
,
pModify
->
tableName
);
pInserter
->
vgId
=
pModify
->
pVgroupList
->
vgroups
[
0
].
vgId
;
pInserter
->
epSet
=
pModify
->
pVgroupList
->
vgroups
[
0
].
epSet
;
pInserter
->
explain
=
(
QUERY_NODE_EXPLAIN_STMT
==
nodeType
(
pCxt
->
pPlanCxt
->
pAstRoot
)
?
true
:
false
);
vgroupInfoToNodeAddr
(
pModify
->
pVgroupList
->
vgroups
,
&
pSubplan
->
execNode
);
int32_t
code
=
setListSlotId
(
pCxt
,
pSubplan
->
pNode
->
pOutputDataBlockDesc
->
dataBlockId
,
-
1
,
pModify
->
pInsertCols
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录