Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
08bd344d
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
08bd344d
编写于
3月 30, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
5fae817e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
19 deletion
+23
-19
source/libs/qcom/src/queryExplain.c
source/libs/qcom/src/queryExplain.c
+11
-11
source/libs/scheduler/inc/schedulerInt.h
source/libs/scheduler/inc/schedulerInt.h
+4
-4
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+8
-4
未找到文件。
source/libs/qcom/src/queryExplain.c
浏览文件 @
08bd344d
...
@@ -31,7 +31,7 @@ void qFreeExplainResTree(SExplainResNode *res) {
...
@@ -31,7 +31,7 @@ void qFreeExplainResTree(SExplainResNode *res) {
FOREACH
(
node
,
res
->
pChildren
)
{
FOREACH
(
node
,
res
->
pChildren
)
{
qFreeExplainResTree
((
SExplainResNode
*
)
node
);
qFreeExplainResTree
((
SExplainResNode
*
)
node
);
}
}
nodes
Destroy
List
(
res
->
pChildren
);
nodes
Clear
List
(
res
->
pChildren
);
taosMemoryFreeClear
(
res
);
taosMemoryFreeClear
(
res
);
}
}
...
@@ -214,7 +214,7 @@ int32_t qExplainResAppendRow(SExplainRowCtx *ctx, char *tbuf, int32_t len, int32
...
@@ -214,7 +214,7 @@ int32_t qExplainResAppendRow(SExplainRowCtx *ctx, char *tbuf, int32_t len, int32
row
.
len
=
len
;
row
.
len
=
len
;
ctx
->
totalSize
+=
len
;
ctx
->
totalSize
+=
len
;
if
(
taosArrayPush
(
ctx
->
rows
,
&
row
))
{
if
(
NULL
==
taosArrayPush
(
ctx
->
rows
,
&
row
))
{
qError
(
"taosArrayPush row to explain res rows failed"
);
qError
(
"taosArrayPush row to explain res rows failed"
);
taosMemoryFree
(
row
.
buf
);
taosMemoryFree
(
row
.
buf
);
QRY_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
QRY_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
...
@@ -273,9 +273,9 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -273,9 +273,9 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
EXPLAIN_ROW_END
();
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
if
(
pTblScanNode
->
pScan
Conditions
)
{
if
(
pTblScanNode
->
scan
.
node
.
p
Conditions
)
{
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_FILTER_FORMAT
);
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_FILTER_FORMAT
);
QRY_ERR_RET
(
nodesNodeToSQL
(
pTblScanNode
->
pScan
Conditions
,
tbuf
,
QUERY_EXPLAIN_MAX_RES_LEN
,
&
tlen
));
QRY_ERR_RET
(
nodesNodeToSQL
(
pTblScanNode
->
scan
.
node
.
p
Conditions
,
tbuf
,
QUERY_EXPLAIN_MAX_RES_LEN
,
&
tlen
));
EXPLAIN_ROW_END
();
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
}
}
...
@@ -301,7 +301,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -301,7 +301,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
}
}
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:{
case
QUERY_NODE_PHYSICAL_PLAN_PROJECT
:{
SProjectPhysiNode
*
pPrjNode
=
(
SProjectPhysiNode
*
)
pNode
;
SProjectPhysiNode
*
pPrjNode
=
(
SProjectPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_PROJECTION_FORMAT
,
pPrjNode
->
pProjections
->
length
,
pPrjNode
->
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_PROJECTION_FORMAT
,
pPrjNode
->
pProjections
->
length
,
pPrjNode
->
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
@@ -318,7 +318,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -318,7 +318,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
}
}
case
QUERY_NODE_PHYSICAL_PLAN_JOIN
:{
case
QUERY_NODE_PHYSICAL_PLAN_JOIN
:{
SJoinPhysiNode
*
pJoinNode
=
(
SJoinPhysiNode
*
)
pNode
;
SJoinPhysiNode
*
pJoinNode
=
(
SJoinPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_JOIN_FORMAT
,
EXPLAIN_JOIN_STRING
(
pJoinNode
->
joinType
),
pJoinNode
->
pTargets
->
length
,
pJoinNode
->
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_JOIN_FORMAT
,
EXPLAIN_JOIN_STRING
(
pJoinNode
->
joinType
),
pJoinNode
->
pTargets
->
length
,
pJoinNode
->
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
@@ -340,7 +340,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -340,7 +340,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
}
}
case
QUERY_NODE_PHYSICAL_PLAN_AGG
:{
case
QUERY_NODE_PHYSICAL_PLAN_AGG
:{
SAggPhysiNode
*
pAggNode
=
(
SAggPhysiNode
*
)
pNode
;
SAggPhysiNode
*
pAggNode
=
(
SAggPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_AGG_FORMAT
,
pAggNode
->
pAggFuncs
->
length
,
pAggNode
->
pGroupKeys
->
length
,
pAggNode
->
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_AGG_FORMAT
,
pAggNode
->
pAggFuncs
->
length
,
pAggNode
->
pGroupKeys
->
length
,
pAggNode
->
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
@@ -357,7 +357,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -357,7 +357,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
}
}
case
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
:{
case
QUERY_NODE_PHYSICAL_PLAN_EXCHANGE
:{
SExchangePhysiNode
*
pExchNode
=
(
SExchangePhysiNode
*
)
pNode
;
SExchangePhysiNode
*
pExchNode
=
(
SExchangePhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_EXCHANGE_FORMAT
,
pExchNode
->
pSrcEndPoints
->
length
,
pExchNode
->
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_EXCHANGE_FORMAT
,
pExchNode
->
pSrcEndPoints
->
length
,
pExchNode
->
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
@@ -374,7 +374,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -374,7 +374,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
}
}
case
QUERY_NODE_PHYSICAL_PLAN_SORT
:{
case
QUERY_NODE_PHYSICAL_PLAN_SORT
:{
SSortPhysiNode
*
pSortNode
=
(
SSortPhysiNode
*
)
pNode
;
SSortPhysiNode
*
pSortNode
=
(
SSortPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_SORT_FORMAT
,
pSortNode
->
pSortKeys
->
length
,
pSortNode
->
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_SORT_FORMAT
,
pSortNode
->
pSortKeys
->
length
,
pSortNode
->
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
@@ -392,7 +392,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -392,7 +392,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
case
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
:{
case
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
:{
SIntervalPhysiNode
*
pIntNode
=
(
SIntervalPhysiNode
*
)
pNode
;
SIntervalPhysiNode
*
pIntNode
=
(
SIntervalPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_INTERVAL_FORMAT
,
qGetNameFromColumnNode
(
pIntNode
->
pTspk
),
pIntNode
->
window
.
pFuncs
->
length
,
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_INTERVAL_FORMAT
,
qGetNameFromColumnNode
(
pIntNode
->
pTspk
),
pIntNode
->
window
.
pFuncs
->
length
,
pIntNode
->
interval
,
pIntNode
->
intervalUnit
,
pIntNode
->
offset
,
pIntNode
->
intervalUnit
,
pIntNode
->
sliding
,
pIntNode
->
slidingUnit
,
pIntNode
->
window
.
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
pIntNode
->
interval
,
pIntNode
->
intervalUnit
,
pIntNode
->
offset
,
pIntNode
->
intervalUnit
,
pIntNode
->
sliding
,
pIntNode
->
slidingUnit
,
pIntNode
->
window
.
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
@@ -415,7 +415,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
...
@@ -415,7 +415,7 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainRowCtx *ctx
}
}
case
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
:{
case
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
:{
SSessionWinodwPhysiNode
*
pIntNode
=
(
SSessionWinodwPhysiNode
*
)
pNode
;
SSessionWinodwPhysiNode
*
pIntNode
=
(
SSessionWinodwPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_SESSION_FORMAT
,
pIntNode
->
gap
,
pIntNode
->
window
.
pFuncs
->
length
,
pIntNode
->
window
.
node
.
pOutputDataBlockDesc
->
resul
tRowSize
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_SESSION_FORMAT
,
pIntNode
->
gap
,
pIntNode
->
window
.
pFuncs
->
length
,
pIntNode
->
window
.
node
.
pOutputDataBlockDesc
->
outpu
tRowSize
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
}
}
...
...
source/libs/scheduler/inc/schedulerInt.h
浏览文件 @
08bd344d
...
@@ -147,10 +147,10 @@ typedef struct SSchTask {
...
@@ -147,10 +147,10 @@ typedef struct SSchTask {
}
SSchTask
;
}
SSchTask
;
typedef
struct
SSchJobAttr
{
typedef
struct
SSchJobAttr
{
bool
analyzeExplain
;
EExplainMode
explainMode
;
bool
syncSchedule
;
bool
syncSchedule
;
bool
queryJob
;
bool
queryJob
;
bool
needFlowCtrl
;
bool
needFlowCtrl
;
}
SSchJobAttr
;
}
SSchJobAttr
;
typedef
struct
SSchJob
{
typedef
struct
SSchJob
{
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
08bd344d
...
@@ -2177,7 +2177,7 @@ static int32_t schExecJobImpl(void *transport, SArray *pNodeList, SQueryPlan *pD
...
@@ -2177,7 +2177,7 @@ static int32_t schExecJobImpl(void *transport, SArray *pNodeList, SQueryPlan *pD
SCH_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
SCH_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
}
pJob
->
attr
.
analyzeExplain
=
(
EXPLAIN_MODE_ANALYZE
==
pDag
->
explainInfo
.
mode
)
;
pJob
->
attr
.
explainMode
=
pDag
->
explainInfo
.
mode
;
pJob
->
attr
.
syncSchedule
=
syncSchedule
;
pJob
->
attr
.
syncSchedule
=
syncSchedule
;
pJob
->
transport
=
transport
;
pJob
->
transport
=
transport
;
pJob
->
sql
=
sql
;
pJob
->
sql
=
sql
;
...
@@ -2528,11 +2528,15 @@ int32_t schedulerFetchRows(int64_t job, void **pData) {
...
@@ -2528,11 +2528,15 @@ int32_t schedulerFetchRows(int64_t job, void **pData) {
SCH_JOB_DLOG
(
"job already succeed, status:%s"
,
jobTaskStatusStr
(
status
));
SCH_JOB_DLOG
(
"job already succeed, status:%s"
,
jobTaskStatusStr
(
status
));
goto
_return
;
goto
_return
;
}
else
if
(
status
==
JOB_TASK_STATUS_PARTIAL_SUCCEED
)
{
}
else
if
(
status
==
JOB_TASK_STATUS_PARTIAL_SUCCEED
)
{
SCH_ERR_JRET
(
schFetchFromRemote
(
pJob
));
if
(
!
pJob
->
attr
.
explainMode
==
EXPLAIN_MODE_STATIC
)
{
SCH_ERR_JRET
(
schFetchFromRemote
(
pJob
));
tsem_wait
(
&
pJob
->
rspSem
);
}
}
else
{
SCH_JOB_ELOG
(
"job status error for fetch, status:%s"
,
jobTaskStatusStr
(
status
));
SCH_ERR_JRET
(
TSDB_CODE_SCH_STATUS_ERROR
);
}
}
tsem_wait
(
&
pJob
->
rspSem
);
status
=
SCH_GET_JOB_STATUS
(
pJob
);
status
=
SCH_GET_JOB_STATUS
(
pJob
);
if
(
JOB_TASK_STATUS_FAILED
==
status
||
JOB_TASK_STATUS_DROPPING
==
status
)
{
if
(
JOB_TASK_STATUS_FAILED
==
status
||
JOB_TASK_STATUS_DROPPING
==
status
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录