Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
70164f9f
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看板
提交
70164f9f
编写于
11月 24, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: group by tbname optimize
上级
59ea486b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
43 addition
and
3 deletion
+43
-3
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+2
-0
source/libs/executor/src/exchangeoperator.c
source/libs/executor/src/exchangeoperator.c
+1
-1
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
+8
-1
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+11
-1
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+1
-0
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+12
-0
未找到文件。
include/libs/nodes/plannodes.h
浏览文件 @
70164f9f
...
...
@@ -171,6 +171,7 @@ typedef struct SExchangeLogicNode {
SLogicNode
node
;
int32_t
srcStartGroupId
;
int32_t
srcEndGroupId
;
bool
seqRecvData
;
}
SExchangeLogicNode
;
typedef
struct
SMergeLogicNode
{
...
...
@@ -416,6 +417,7 @@ typedef struct SExchangePhysiNode {
int32_t
srcEndGroupId
;
bool
singleChannel
;
SNodeList
*
pSrcEndPoints
;
// element is SDownstreamSource, scheduler fill by calling qSetSuplanExecutionNode
bool
seqRecvData
;
}
SExchangePhysiNode
;
typedef
struct
SMergePhysiNode
{
...
...
source/libs/executor/src/exchangeoperator.c
浏览文件 @
70164f9f
...
...
@@ -299,7 +299,7 @@ SOperatorInfo* createExchangeOperatorInfo(void* pTransporter, SExchangePhysiNode
SExchangeOpStopInfo
stopInfo
=
{
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
,
pInfo
->
self
};
qAppendTaskStopInfo
(
pTaskInfo
,
&
stopInfo
);
pInfo
->
seqLoadData
=
fals
e
;
pInfo
->
seqLoadData
=
tru
e
;
pInfo
->
pTransporter
=
pTransporter
;
setOperatorInfo
(
pOperator
,
"ExchangeOperator"
,
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
70164f9f
...
...
@@ -434,6 +434,7 @@ static int32_t logicExchangeCopy(const SExchangeLogicNode* pSrc, SExchangeLogicN
COPY_BASE_OBJECT_FIELD
(
node
,
logicNodeCopy
);
COPY_SCALAR_FIELD
(
srcStartGroupId
);
COPY_SCALAR_FIELD
(
srcEndGroupId
);
COPY_SCALAR_FIELD
(
seqRecvData
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
70164f9f
...
...
@@ -1864,6 +1864,7 @@ static int32_t jsonToPhysiAggNode(const SJson* pJson, void* pObj) {
static
const
char
*
jkExchangePhysiPlanSrcStartGroupId
=
"SrcStartGroupId"
;
static
const
char
*
jkExchangePhysiPlanSrcEndGroupId
=
"SrcEndGroupId"
;
static
const
char
*
jkExchangePhysiPlanSrcEndPoints
=
"SrcEndPoints"
;
static
const
char
*
jkExchangePhysiPlanSeqRecvData
=
"SeqRecvData"
;
static
int32_t
physiExchangeNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SExchangePhysiNode
*
pNode
=
(
const
SExchangePhysiNode
*
)
pObj
;
...
...
@@ -1878,6 +1879,9 @@ static int32_t physiExchangeNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodeListToJson
(
pJson
,
jkExchangePhysiPlanSrcEndPoints
,
pNode
->
pSrcEndPoints
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddBoolToObject
(
pJson
,
jkExchangePhysiPlanSeqRecvData
,
pNode
->
seqRecvData
);
}
return
code
;
}
...
...
@@ -1895,6 +1899,9 @@ static int32_t jsonToPhysiExchangeNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeList
(
pJson
,
jkExchangePhysiPlanSrcEndPoints
,
&
pNode
->
pSrcEndPoints
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkExchangePhysiPlanSeqRecvData
,
&
pNode
->
seqRecvData
);
}
return
code
;
}
...
...
source/libs/nodes/src/nodesMsgFuncs.c
浏览文件 @
70164f9f
...
...
@@ -2428,7 +2428,8 @@ enum {
PHY_EXCHANGE_CODE_SRC_START_GROUP_ID
,
PHY_EXCHANGE_CODE_SRC_END_GROUP_ID
,
PHY_EXCHANGE_CODE_SINGLE_CHANNEL
,
PHY_EXCHANGE_CODE_SRC_ENDPOINTS
PHY_EXCHANGE_CODE_SRC_ENDPOINTS
,
PHY_EXCHANGE_CODE_SEQ_RECV_DATA
};
static
int32_t
physiExchangeNodeToMsg
(
const
void
*
pObj
,
STlvEncoder
*
pEncoder
)
{
...
...
@@ -2447,6 +2448,9 @@ static int32_t physiExchangeNodeToMsg(const void* pObj, STlvEncoder* pEncoder) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvEncodeObj
(
pEncoder
,
PHY_EXCHANGE_CODE_SRC_ENDPOINTS
,
nodeListToMsg
,
pNode
->
pSrcEndPoints
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tlvEncodeBool
(
pEncoder
,
PHY_EXCHANGE_CODE_SEQ_RECV_DATA
,
pNode
->
seqRecvData
);
}
return
code
;
}
...
...
@@ -2473,6 +2477,9 @@ static int32_t msgToPhysiExchangeNode(STlvDecoder* pDecoder, void* pObj) {
case
PHY_EXCHANGE_CODE_SRC_ENDPOINTS
:
code
=
msgToNodeListFromTlv
(
pTlv
,
(
void
**
)
&
pNode
->
pSrcEndPoints
);
break
;
case
PHY_EXCHANGE_CODE_SEQ_RECV_DATA
:
code
=
tlvDecodeBool
(
pTlv
,
&
pNode
->
seqRecvData
);
break
;
default:
break
;
}
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
70164f9f
...
...
@@ -3685,9 +3685,19 @@ static int32_t translateInsertProject(STranslateContext* pCxt, SInsertStmt* pIns
return
addOrderByPrimaryKeyToQuery
(
pCxt
,
pPrimaryKeyExpr
,
pInsert
->
pQuery
);
}
static
int32_t
translateInsertTable
(
STranslateContext
*
pCxt
,
SNode
*
pTable
)
{
int32_t
code
=
translateFrom
(
pCxt
,
pTable
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
TSDB_CHILD_TABLE
!=
((
SRealTableNode
*
)
pTable
)
->
pMeta
->
tableType
&&
TSDB_NORMAL_TABLE
!=
((
SRealTableNode
*
)
pTable
)
->
pMeta
->
tableType
)
{
code
=
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_SYNTAX_ERROR
,
"insert data into super table is not supported"
);
}
return
code
;
}
static
int32_t
translateInsert
(
STranslateContext
*
pCxt
,
SInsertStmt
*
pInsert
)
{
pCxt
->
pCurrStmt
=
(
SNode
*
)
pInsert
;
int32_t
code
=
translate
From
(
pCxt
,
pInsert
->
pTable
);
int32_t
code
=
translate
InsertTable
(
pCxt
,
pInsert
->
pTable
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
translateInsertCols
(
pCxt
,
pInsert
);
}
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
70164f9f
...
...
@@ -1064,6 +1064,7 @@ static int32_t doCreateExchangePhysiNode(SPhysiPlanContext* pCxt, SExchangeLogic
pExchange
->
srcStartGroupId
=
pExchangeLogicNode
->
srcStartGroupId
;
pExchange
->
srcEndGroupId
=
pExchangeLogicNode
->
srcEndGroupId
;
pExchange
->
seqRecvData
=
pExchangeLogicNode
->
seqRecvData
;
*
pPhyNode
=
(
SPhysiNode
*
)
pExchange
;
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
70164f9f
...
...
@@ -733,6 +733,17 @@ static int32_t stbSplSplitWindowForCrossTable(SSplitContext* pCxt, SStableSplitI
return
TSDB_CODE_PLAN_INTERNAL_ERROR
;
}
static
bool
stbSplNeedSeqRecvData
(
SLogicNode
*
pNode
)
{
if
(
NULL
==
pNode
)
{
return
false
;
}
if
(
NULL
!=
pNode
->
pLimit
||
NULL
!=
pNode
->
pSlimit
)
{
return
true
;
}
return
stbSplNeedSeqRecvData
(
pNode
->
pParent
);
}
static
int32_t
stbSplSplitWindowForPartTable
(
SSplitContext
*
pCxt
,
SStableSplitInfo
*
pInfo
)
{
if
(
pCxt
->
pPlanCxt
->
streamQuery
)
{
SPLIT_FLAG_SET_MASK
(
pInfo
->
pSubplan
->
splitFlag
,
SPLIT_FLAG_STABLE_SPLIT
);
...
...
@@ -748,6 +759,7 @@ static int32_t stbSplSplitWindowForPartTable(SSplitContext* pCxt, SStableSplitIn
code
=
replaceLogicNode
(
pInfo
->
pSubplan
,
pInfo
->
pSplitNode
,
(
SLogicNode
*
)
pExchange
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
pExchange
->
seqRecvData
=
stbSplNeedSeqRecvData
((
SLogicNode
*
)
pExchange
);
code
=
nodesListMakeStrictAppend
(
&
pInfo
->
pSubplan
->
pChildren
,
(
SNode
*
)
splCreateScanSubplan
(
pCxt
,
pInfo
->
pSplitNode
,
SPLIT_FLAG_STABLE_SPLIT
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录