Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
056301fb
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
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,发现更多精彩内容 >>
提交
056301fb
编写于
6月 20, 2022
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: disable eliminate projection when repeat proj column name
上级
9bb21ebb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
10 deletion
+21
-10
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+5
-8
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+15
-1
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+1
-1
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
056301fb
...
...
@@ -235,7 +235,7 @@ int32_t getTableList(void* metaHandle, SScanPhysiNode* pScanNode, STableListInfo
terrno
=
code
;
return
code
;
}
else
{
qDebug
(
"sucess to get tableIds, size: %d, suid: %"
PRIu64
""
,
(
int
)
taosArrayGetSize
(
res
),
tableUid
);
qDebug
(
"suc
c
ess to get tableIds, size: %d, suid: %"
PRIu64
""
,
(
int
)
taosArrayGetSize
(
res
),
tableUid
);
}
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
res
);
i
++
)
{
...
...
@@ -319,12 +319,10 @@ SArray* extractColMatchInfo(SNodeList* pNodeList, SDataBlockDescNode* pOutputNod
continue
;
}
bool
foundSource
=
false
;
SColMatchInfo
*
info
=
NULL
;
for
(
int32_t
j
=
0
;
j
<
taosArrayGetSize
(
pList
);
++
j
)
{
info
=
taosArrayGet
(
pList
,
j
);
if
(
info
->
targetSlotId
==
pNode
->
slotId
)
{
foundSource
=
true
;
break
;
}
}
...
...
@@ -332,7 +330,6 @@ SArray* extractColMatchInfo(SNodeList* pNodeList, SDataBlockDescNode* pOutputNod
if
(
pNode
->
output
)
{
(
*
numOfOutputCols
)
+=
1
;
}
else
{
ASSERT
(
foundSource
);
info
->
output
=
false
;
}
}
...
...
@@ -595,10 +592,10 @@ void relocateColumnData(SSDataBlock* pBlock, const SArray* pColMatchInfo, SArray
while
(
i
<
numOfSrcCols
&&
j
<
taosArrayGetSize
(
pColMatchInfo
))
{
SColumnInfoData
*
p
=
taosArrayGet
(
pCols
,
i
);
SColMatchInfo
*
pmInfo
=
taosArrayGet
(
pColMatchInfo
,
j
);
//
if (!pmInfo->output) {
//
j++;
//
continue;
//
}
if
(
!
pmInfo
->
output
)
{
j
++
;
continue
;
}
if
(
p
->
info
.
colId
==
pmInfo
->
colId
)
{
SColumnInfoData
*
pDst
=
taosArrayGet
(
pBlock
->
pDataBlock
,
pmInfo
->
targetSlotId
);
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
056301fb
...
...
@@ -1092,14 +1092,27 @@ static bool eliminateProjOptMayBeOptimized(SLogicNode* pNode) {
return
false
;
}
SHashObj
*
pProjColNameHash
=
taosHashInit
(
16
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
SNode
*
pProjection
;
FOREACH
(
pProjection
,
pProjectNode
->
pProjections
)
{
SExprNode
*
pExprNode
=
(
SExprNode
*
)
pProjection
;
if
(
QUERY_NODE_COLUMN
!=
nodeType
(
pExprNode
))
{
taosHashCleanup
(
pProjColNameHash
);
return
false
;
}
char
*
projColumnName
=
((
SColumnNode
*
)
pProjection
)
->
colName
;
int32_t
*
pExist
=
taosHashGet
(
pProjColNameHash
,
projColumnName
,
strlen
(
projColumnName
));
if
(
NULL
!=
pExist
)
{
taosHashCleanup
(
pProjColNameHash
);
return
false
;
}
else
{
int32_t
exist
=
1
;
taosHashPut
(
pProjColNameHash
,
projColumnName
,
strlen
(
projColumnName
),
&
exist
,
sizeof
(
exist
));
}
}
taosHashCleanup
(
pProjColNameHash
);
return
true
;
}
...
...
@@ -1110,13 +1123,14 @@ static int32_t eliminateProjOptimizeImpl(SOptimizeContext* pCxt, SLogicSubplan*
SNode
*
pProjection
=
NULL
;
FOREACH
(
pProjection
,
pProjectNode
->
pProjections
)
{
SColumnNode
*
projColumn
=
(
SColumnNode
*
)
pProjection
;
char
*
projColumnName
=
projColumn
->
colName
;
SNode
*
pChildTarget
=
NULL
;
FOREACH
(
pChildTarget
,
pChild
->
pTargets
)
{
SExprNode
*
childExpr
=
(
SExprNode
*
)
pChildTarget
;
char
*
projColumnName
=
projColumn
->
colName
;
if
(
QUERY_NODE_COLUMN
==
nodeType
(
childExpr
)
&&
strcmp
(
projColumnName
,
((
SColumnNode
*
)
childExpr
)
->
colName
)
==
0
||
strcmp
(
projColumnName
,
childExpr
->
aliasName
)
==
0
)
{
nodesListAppend
(
pNewChildTargets
,
nodesCloneNode
(
pChildTarget
));
break
;
}
}
}
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
056301fb
...
...
@@ -526,7 +526,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex
atomic_store_8
(
&
ctx
->
taskType
,
taskType
);
atomic_store_8
(
&
ctx
->
explain
,
explain
);
/*QW_TASK_DLOGL("subplan json string, len:%d, %s", qwMsg->msgLen, qwMsg->msg);*/
QW_TASK_DLOGL
(
"subplan json string, len:%d, %s"
,
qwMsg
->
msgLen
,
qwMsg
->
msg
);
code
=
qStringToSubplan
(
qwMsg
->
msg
,
&
plan
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录