Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9de235f3
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
未验证
提交
9de235f3
编写于
3月 11, 2022
作者:
X
Xiaoyu Wang
提交者:
GitHub
3月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10700 from taosdata/feature/3.0_query_integrate_wxy
TD-13981 show databases rewrite
上级
a5459df0
028e6d16
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
88 addition
and
29 deletion
+88
-29
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+5
-1
include/libs/planner/planner.h
include/libs/planner/planner.h
+1
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+6
-1
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+75
-27
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+1
-0
未找到文件。
include/libs/nodes/plannodes.h
浏览文件 @
9de235f3
...
@@ -147,9 +147,13 @@ typedef struct SScanPhysiNode {
...
@@ -147,9 +147,13 @@ typedef struct SScanPhysiNode {
SName
tableName
;
SName
tableName
;
}
SScanPhysiNode
;
}
SScanPhysiNode
;
typedef
SScanPhysiNode
SSystemTableScanPhysiNode
;
typedef
SScanPhysiNode
STagScanPhysiNode
;
typedef
SScanPhysiNode
STagScanPhysiNode
;
typedef
struct
SSystemTableScanPhysiNode
{
SScanPhysiNode
scan
;
SEpSet
mgmtEpSet
;
}
SSystemTableScanPhysiNode
;
typedef
struct
STableScanPhysiNode
{
typedef
struct
STableScanPhysiNode
{
SScanPhysiNode
scan
;
SScanPhysiNode
scan
;
uint8_t
scanFlag
;
// denotes reversed scan of data or not
uint8_t
scanFlag
;
// denotes reversed scan of data or not
...
...
include/libs/planner/planner.h
浏览文件 @
9de235f3
...
@@ -25,6 +25,7 @@ extern "C" {
...
@@ -25,6 +25,7 @@ extern "C" {
typedef
struct
SPlanContext
{
typedef
struct
SPlanContext
{
uint64_t
queryId
;
uint64_t
queryId
;
int32_t
acctId
;
int32_t
acctId
;
SEpSet
mgmtEpSet
;
SNode
*
pAstRoot
;
SNode
*
pAstRoot
;
}
SPlanContext
;
}
SPlanContext
;
...
...
source/client/src/clientImpl.c
浏览文件 @
9de235f3
...
@@ -194,7 +194,12 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) {
...
@@ -194,7 +194,12 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) {
int32_t
getPlan
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
SQueryPlan
**
pPlan
,
SArray
*
pNodeList
)
{
int32_t
getPlan
(
SRequestObj
*
pRequest
,
SQuery
*
pQuery
,
SQueryPlan
**
pPlan
,
SArray
*
pNodeList
)
{
pRequest
->
type
=
pQuery
->
msgType
;
pRequest
->
type
=
pQuery
->
msgType
;
SPlanContext
cxt
=
{
.
queryId
=
pRequest
->
requestId
,
.
pAstRoot
=
pQuery
->
pRoot
,
.
acctId
=
pRequest
->
pTscObj
->
acctId
};
SPlanContext
cxt
=
{
.
queryId
=
pRequest
->
requestId
,
.
acctId
=
pRequest
->
pTscObj
->
acctId
,
.
mgmtEpSet
=
getEpSet_s
(
&
pRequest
->
pTscObj
->
pAppInfo
->
mgmtEp
),
.
pAstRoot
=
pQuery
->
pRoot
};
int32_t
code
=
qCreateQueryPlan
(
&
cxt
,
pPlan
,
pNodeList
);
int32_t
code
=
qCreateQueryPlan
(
&
cxt
,
pPlan
,
pNodeList
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
return
code
;
return
code
;
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
9de235f3
...
@@ -442,12 +442,85 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
...
@@ -442,12 +442,85 @@ static int32_t jsonToPhysiTableScanNode(const SJson* pJson, void* pObj) {
return
code
;
return
code
;
}
}
static
const
char
*
jkEndPointFqdn
=
"Fqdn"
;
static
const
char
*
jkEndPointPort
=
"Port"
;
static
int32_t
epToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SEp
*
pNode
=
(
const
SEp
*
)
pObj
;
int32_t
code
=
tjsonAddStringToObject
(
pJson
,
jkEndPointFqdn
,
pNode
->
fqdn
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkEndPointPort
,
pNode
->
port
);
}
return
code
;
}
static
int32_t
jsonToEp
(
const
SJson
*
pJson
,
void
*
pObj
)
{
SEp
*
pNode
=
(
SEp
*
)
pObj
;
int32_t
code
=
tjsonGetStringValue
(
pJson
,
jkEndPointFqdn
,
pNode
->
fqdn
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetSmallIntValue
(
pJson
,
jkEndPointPort
,
&
pNode
->
port
);
}
return
code
;
}
static
const
char
*
jkEpSetInUse
=
"InUse"
;
static
const
char
*
jkEpSetNumOfEps
=
"NumOfEps"
;
static
const
char
*
jkEpSetEps
=
"Eps"
;
static
int32_t
epSetToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SEpSet
*
pNode
=
(
const
SEpSet
*
)
pObj
;
int32_t
code
=
tjsonAddIntegerToObject
(
pJson
,
jkEpSetInUse
,
pNode
->
inUse
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkEpSetNumOfEps
,
pNode
->
numOfEps
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddArray
(
pJson
,
jkEpSetEps
,
epToJson
,
pNode
->
eps
,
sizeof
(
SEp
),
pNode
->
numOfEps
);
}
return
code
;
}
static
int32_t
jsonToEpSet
(
const
SJson
*
pJson
,
void
*
pObj
)
{
SEpSet
*
pNode
=
(
SEpSet
*
)
pObj
;
int32_t
code
=
tjsonGetTinyIntValue
(
pJson
,
jkEpSetInUse
,
&
pNode
->
inUse
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetTinyIntValue
(
pJson
,
jkEpSetNumOfEps
,
&
pNode
->
numOfEps
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonToArray
(
pJson
,
jkEpSetEps
,
jsonToEp
,
pNode
->
eps
,
sizeof
(
SEp
));
}
return
code
;
}
static
const
char
*
jkSysTableScanPhysiPlanMnodeEpSet
=
"MnodeEpSet"
;
static
int32_t
physiSysTableScanNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
static
int32_t
physiSysTableScanNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
return
physiScanNodeToJson
(
pObj
,
pJson
);
const
SSystemTableScanPhysiNode
*
pNode
=
(
const
SSystemTableScanPhysiNode
*
)
pObj
;
int32_t
code
=
physiScanNodeToJson
(
pObj
,
pJson
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddObject
(
pJson
,
jkSysTableScanPhysiPlanMnodeEpSet
,
epSetToJson
,
&
pNode
->
mgmtEpSet
);
}
return
code
;
}
}
static
int32_t
jsonToPhysiSysTableScanNode
(
const
SJson
*
pJson
,
void
*
pObj
)
{
static
int32_t
jsonToPhysiSysTableScanNode
(
const
SJson
*
pJson
,
void
*
pObj
)
{
return
jsonToPhysiScanNode
(
pJson
,
pObj
);
SSystemTableScanPhysiNode
*
pNode
=
(
SSystemTableScanPhysiNode
*
)
pObj
;
int32_t
code
=
jsonToPhysiScanNode
(
pJson
,
pObj
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonToObject
(
pJson
,
jkSysTableScanPhysiPlanMnodeEpSet
,
jsonToEpSet
,
&
pNode
->
mgmtEpSet
);
}
return
code
;
}
}
static
const
char
*
jkProjectPhysiPlanProjections
=
"Projections"
;
static
const
char
*
jkProjectPhysiPlanProjections
=
"Projections"
;
...
@@ -635,31 +708,6 @@ static int32_t jsonToSubplanId(const SJson* pJson, void* pObj) {
...
@@ -635,31 +708,6 @@ static int32_t jsonToSubplanId(const SJson* pJson, void* pObj) {
return
code
;
return
code
;
}
}
static
const
char
*
jkEndPointFqdn
=
"Fqdn"
;
static
const
char
*
jkEndPointPort
=
"Port"
;
static
int32_t
epToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SEp
*
pNode
=
(
const
SEp
*
)
pObj
;
int32_t
code
=
tjsonAddStringToObject
(
pJson
,
jkEndPointFqdn
,
pNode
->
fqdn
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkEndPointPort
,
pNode
->
port
);
}
return
code
;
}
static
int32_t
jsonToEp
(
const
SJson
*
pJson
,
void
*
pObj
)
{
SEp
*
pNode
=
(
SEp
*
)
pObj
;
int32_t
code
=
tjsonGetStringValue
(
pJson
,
jkEndPointFqdn
,
pNode
->
fqdn
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetSmallIntValue
(
pJson
,
jkEndPointPort
,
&
pNode
->
port
);
}
return
code
;
}
static
const
char
*
jkQueryNodeAddrId
=
"Id"
;
static
const
char
*
jkQueryNodeAddrId
=
"Id"
;
static
const
char
*
jkQueryNodeAddrInUse
=
"InUse"
;
static
const
char
*
jkQueryNodeAddrInUse
=
"InUse"
;
static
const
char
*
jkQueryNodeAddrNumOfEps
=
"NumOfEps"
;
static
const
char
*
jkQueryNodeAddrNumOfEps
=
"NumOfEps"
;
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
9de235f3
...
@@ -268,6 +268,7 @@ static SPhysiNode* createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SScan
...
@@ -268,6 +268,7 @@ static SPhysiNode* createSystemTableScanPhysiNode(SPhysiPlanContext* pCxt, SScan
vgroupInfoToNodeAddr
(
pScanLogicNode
->
pVgroupList
->
vgroups
+
i
,
&
addr
);
vgroupInfoToNodeAddr
(
pScanLogicNode
->
pVgroupList
->
vgroups
+
i
,
&
addr
);
taosArrayPush
(
pCxt
->
pExecNodeList
,
&
addr
);
taosArrayPush
(
pCxt
->
pExecNodeList
,
&
addr
);
}
}
pScan
->
mgmtEpSet
=
pCxt
->
pPlanCxt
->
mgmtEpSet
;
return
(
SPhysiNode
*
)
pScan
;
return
(
SPhysiNode
*
)
pScan
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录