Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5d3a6930
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看板
未验证
提交
5d3a6930
编写于
8月 08, 2022
作者:
X
Xiaoyu Wang
提交者:
GitHub
8月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15860 from taosdata/feature/3.0_wxy
fix: project adds whether to ignore the field of group id
上级
dc532554
4345631d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
0 deletion
+26
-0
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+2
-0
source/libs/command/inc/commandInt.h
source/libs/command/inc/commandInt.h
+1
-0
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+5
-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
+14
-0
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+2
-0
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+1
-0
未找到文件。
include/libs/nodes/plannodes.h
浏览文件 @
5d3a6930
...
...
@@ -121,6 +121,7 @@ typedef struct SProjectLogicNode {
SLogicNode
node
;
SNodeList
*
pProjections
;
char
stmtName
[
TSDB_TABLE_NAME_LEN
];
bool
ignoreGroupId
;
}
SProjectLogicNode
;
typedef
struct
SIndefRowsFuncLogicNode
{
...
...
@@ -344,6 +345,7 @@ typedef struct SProjectPhysiNode {
SPhysiNode
node
;
SNodeList
*
pProjections
;
bool
mergeDataBlock
;
bool
ignoreGroupId
;
}
SProjectPhysiNode
;
typedef
struct
SIndefRowsFuncPhysiNode
{
...
...
source/libs/command/inc/commandInt.h
浏览文件 @
5d3a6930
...
...
@@ -58,6 +58,7 @@ extern "C" {
#define EXPLAIN_RATIO_TIME_FORMAT "Ratio: %f"
#define EXPLAIN_MERGE_FORMAT "Merge"
#define EXPLAIN_MERGE_KEYS_FORMAT "Merge Key: "
#define EXPLAIN_IGNORE_GROUPID_FORMAT "Ignore Group Id: %s"
#define EXPLAIN_PLANNING_TIME_FORMAT "Planning Time: %.3f ms"
#define EXPLAIN_EXEC_TIME_FORMAT "Execution Time: %.3f ms"
...
...
source/libs/command/src/explain.c
浏览文件 @
5d3a6930
...
...
@@ -612,6 +612,11 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_OUTPUT_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_IGNORE_GROUPID_FORMAT
,
pPrjNode
->
ignoreGroupId
?
"true"
:
"false"
);
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
if
(
pPrjNode
->
node
.
pConditions
)
{
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_FILTER_FORMAT
);
QRY_ERR_RET
(
nodesNodeToSQL
(
pPrjNode
->
node
.
pConditions
,
tbuf
+
VARSTR_HEADER_SIZE
,
...
...
source/libs/nodes/src/nodesCloneFuncs.c
浏览文件 @
5d3a6930
...
...
@@ -390,6 +390,7 @@ static int32_t logicProjectCopy(const SProjectLogicNode* pSrc, SProjectLogicNode
COPY_BASE_OBJECT_FIELD
(
node
,
logicNodeCopy
);
CLONE_NODE_LIST_FIELD
(
pProjections
);
COPY_CHAR_ARRAY_FIELD
(
stmtName
);
COPY_SCALAR_FIELD
(
ignoreGroupId
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
5d3a6930
...
...
@@ -655,6 +655,7 @@ static int32_t jsonToLogicScanNode(const SJson* pJson, void* pObj) {
}
static
const
char
*
jkProjectLogicPlanProjections
=
"Projections"
;
static
const
char
*
jkProjectLogicPlanIgnoreGroupId
=
"IgnoreGroupId"
;
static
int32_t
logicProjectNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SProjectLogicNode
*
pNode
=
(
const
SProjectLogicNode
*
)
pObj
;
...
...
@@ -663,6 +664,9 @@ static int32_t logicProjectNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodeListToJson
(
pJson
,
jkProjectLogicPlanProjections
,
pNode
->
pProjections
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkProjectLogicPlanIgnoreGroupId
,
pNode
->
ignoreGroupId
);
}
return
code
;
}
...
...
@@ -674,6 +678,9 @@ static int32_t jsonToLogicProjectNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeList
(
pJson
,
jkProjectLogicPlanProjections
,
&
pNode
->
pProjections
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkProjectLogicPlanIgnoreGroupId
,
&
pNode
->
ignoreGroupId
);
}
return
code
;
}
...
...
@@ -1689,6 +1696,7 @@ static int32_t jsonToPhysiSysTableScanNode(const SJson* pJson, void* pObj) {
static
const
char
*
jkProjectPhysiPlanProjections
=
"Projections"
;
static
const
char
*
jkProjectPhysiPlanMergeDataBlock
=
"MergeDataBlock"
;
static
const
char
*
jkProjectPhysiPlanIgnoreGroupId
=
"IgnoreGroupId"
;
static
int32_t
physiProjectNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SProjectPhysiNode
*
pNode
=
(
const
SProjectPhysiNode
*
)
pObj
;
...
...
@@ -1700,6 +1708,9 @@ static int32_t physiProjectNodeToJson(const void* pObj, SJson* pJson) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddBoolToObject
(
pJson
,
jkProjectPhysiPlanMergeDataBlock
,
pNode
->
mergeDataBlock
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddBoolToObject
(
pJson
,
jkProjectPhysiPlanIgnoreGroupId
,
pNode
->
ignoreGroupId
);
}
return
code
;
}
...
...
@@ -1714,6 +1725,9 @@ static int32_t jsonToPhysiProjectNode(const SJson* pJson, void* pObj) {
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkProjectPhysiPlanMergeDataBlock
,
&
pNode
->
mergeDataBlock
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkProjectPhysiPlanIgnoreGroupId
,
&
pNode
->
ignoreGroupId
);
}
return
code
;
}
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
5d3a6930
...
...
@@ -865,6 +865,7 @@ static int32_t createProjectLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSel
TSWAP
(
pProject
->
node
.
pLimit
,
pSelect
->
pLimit
);
TSWAP
(
pProject
->
node
.
pSlimit
,
pSelect
->
pSlimit
);
pProject
->
ignoreGroupId
=
(
NULL
==
pSelect
->
pPartitionByList
);
pProject
->
node
.
groupAction
=
(
!
pSelect
->
isSubquery
&&
pCxt
->
pPlanCxt
->
streamQuery
)
?
GROUP_ACTION_KEEP
:
GROUP_ACTION_CLEAR
;
pProject
->
node
.
requireDataOrder
=
DATA_ORDER_LEVEL_NONE
;
...
...
@@ -1078,6 +1079,7 @@ static int32_t createSetOpProjectLogicNode(SLogicPlanContext* pCxt, SSetOperator
if
(
NULL
==
pSetOperator
->
pOrderByList
)
{
TSWAP
(
pProject
->
node
.
pLimit
,
pSetOperator
->
pLimit
);
}
pProject
->
ignoreGroupId
=
true
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
5d3a6930
...
...
@@ -998,6 +998,7 @@ static int32_t createProjectPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pChild
}
pProject
->
mergeDataBlock
=
projectCanMergeDataBlock
(
pProjectLogicNode
);
pProject
->
ignoreGroupId
=
pProjectLogicNode
->
ignoreGroupId
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
if
(
0
==
LIST_LENGTH
(
pChildren
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录