Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dc3ecc0a
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看板
提交
dc3ecc0a
编写于
1月 07, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] refactor.
上级
bd386044
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
45 addition
and
24 deletion
+45
-24
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+7
-7
include/libs/parser/parser.h
include/libs/parser/parser.h
+12
-4
include/libs/planner/planner.h
include/libs/planner/planner.h
+7
-3
include/libs/scheduler/scheduler.h
include/libs/scheduler/scheduler.h
+10
-0
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+2
-1
source/libs/parser/src/dCDAstProcess.c
source/libs/parser/src/dCDAstProcess.c
+5
-6
source/libs/parser/src/insertParser.c
source/libs/parser/src/insertParser.c
+0
-1
source/libs/parser/src/parser.c
source/libs/parser/src/parser.c
+2
-2
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
dc3ecc0a
...
...
@@ -65,14 +65,14 @@ int32_t catalogGetDBVgroupVersion(struct SCatalog* pCatalog, const char* dbName,
/**
* Get a DB's all vgroup info.
* @param pCatalog (input, got with catalogGetHandle)
* @param p
Rpc
(input, rpc object)
* @param p
Transporter
(input, rpc object)
* @param pMgmtEps (input, mnode EPs)
* @param pDBName (input, full db name)
* @param forceUpdate (input, force update db vgroup info from mnode)
* @param pVgroupList (output, vgroup info list, element is SVgroupInfo, NEED to simply free the array by caller)
* @return error code
*/
int32_t
catalogGetDBVgroup
(
struct
SCatalog
*
pCatalog
,
void
*
p
Rpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
bool
forceUpdate
,
SArray
**
pVgroupList
);
int32_t
catalogGetDBVgroup
(
struct
SCatalog
*
pCatalog
,
void
*
p
Transporter
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
bool
forceUpdate
,
SArray
**
pVgroupList
);
int32_t
catalogUpdateDBVgroup
(
struct
SCatalog
*
pCatalog
,
const
char
*
dbName
,
SDBVgroupInfo
*
dbInfo
);
...
...
@@ -112,13 +112,13 @@ int32_t catalogRenewAndGetTableMeta(struct SCatalog* pCatalog, void *pTransporte
/**
* Get a table's actual vgroup, for stable it's all possible vgroup list.
* @param pCatalog (input, got with catalogGetHandle)
* @param p
Rpc
(input, rpc object)
* @param p
Transporter
(input, rpc object)
* @param pMgmtEps (input, mnode EPs)
* @param pTableName (input, table name, NOT including db name)
* @param pVgroupList (output, vgroup info list, element is SVgroupInfo, NEED to simply free the array by caller)
* @return error code
*/
int32_t
catalogGetTableDistVgroup
(
struct
SCatalog
*
pCatalog
,
void
*
p
Rpc
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
SArray
**
pVgroupList
);
int32_t
catalogGetTableDistVgroup
(
struct
SCatalog
*
pCatalog
,
void
*
p
Transporter
,
const
SEpSet
*
pMgmtEps
,
const
SName
*
pTableName
,
SArray
**
pVgroupList
);
/**
* Get a table's vgroup from its name's hash value.
...
...
@@ -135,16 +135,16 @@ int32_t catalogGetTableHashVgroup(struct SCatalog* pCatalog, void * pTransporter
/**
* Get all meta data required in pReq.
* @param pCatalog (input, got with catalogGetHandle)
* @param p
Rpc
(input, rpc object)
* @param p
Transporter
(input, rpc object)
* @param pMgmtEps (input, mnode EPs)
* @param pReq (input, reqest info)
* @param pRsp (output, response data)
* @return error code
*/
int32_t
catalogGetAllMeta
(
struct
SCatalog
*
pCatalog
,
void
*
p
Rpc
,
const
SEpSet
*
pMgmtEps
,
const
SCatalogReq
*
pReq
,
SMetaData
*
pRsp
);
int32_t
catalogGetAllMeta
(
struct
SCatalog
*
pCatalog
,
void
*
p
Transporter
,
const
SEpSet
*
pMgmtEps
,
const
SCatalogReq
*
pReq
,
SMetaData
*
pRsp
);
int32_t
catalogGetQnodeList
(
struct
SCatalog
*
pCatalog
,
void
*
p
Rpc
,
const
SEpSet
*
pMgmtEps
,
SArray
*
pQnodeList
);
int32_t
catalogGetQnodeList
(
struct
SCatalog
*
pCatalog
,
void
*
p
Transporter
,
const
SEpSet
*
pMgmtEps
,
SArray
*
pQnodeList
);
...
...
include/libs/parser/parser.h
浏览文件 @
dc3ecc0a
...
...
@@ -24,7 +24,6 @@ extern "C" {
typedef
struct
SParseContext
{
SParseBasicCtx
ctx
;
int8_t
schemaAttached
;
// denote if submit block is built with table schema or not
const
char
*
pSql
;
// sql string
size_t
sqlLen
;
// length of the sql string
char
*
pMsg
;
// extended error message if exists to help identifying the problem in sql statement.
...
...
@@ -41,8 +40,17 @@ typedef struct SParseContext {
*/
int32_t
qParseQuerySql
(
SParseContext
*
pContext
,
SQueryNode
**
pQuery
);
bool
qIsDdlQuery
(
const
SQueryNode
*
pQuery
);
/**
* Return true if it is a ddl/dcl sql statement
* @param pQuery
* @return
*/
bool
qIsDdlQuery
(
const
SQueryNode
*
pQueryNode
);
/**
* Destroy logic query plan
* @param pQueryNode
*/
void
qDestroyQuery
(
SQueryNode
*
pQueryNode
);
/**
...
...
@@ -62,8 +70,8 @@ void columnListDestroy(SArray* pColumnList);
void
dropAllExprInfo
(
SArray
**
pExprInfo
,
int32_t
numOfLevel
);
typedef
struct
SSourceParam
{
SArray
*
pExprNodeList
;
//Array<struct tExprNode*>
SArray
*
pColumnList
;
//Array<struct SColumn>
SArray
*
pExprNodeList
;
//Array<struct tExprNode*>
SArray
*
pColumnList
;
//Array<struct SColumn>
int32_t
num
;
}
SSourceParam
;
...
...
include/libs/planner/planner.h
浏览文件 @
dc3ecc0a
...
...
@@ -139,9 +139,13 @@ typedef struct SQueryDag {
struct
SQueryNode
;
/**
* Create the physical plan for the query, according to the AST.
*/
/**
* Create the physical plan for the query, according to the AST.
* @param pQueryInfo
* @param pDag
* @param requestId
* @return
*/
int32_t
qCreateQueryDag
(
const
struct
SQueryNode
*
pQueryInfo
,
struct
SQueryDag
**
pDag
,
uint64_t
requestId
);
// Set datasource of this subplan, multiple calls may be made to a subplan.
...
...
include/libs/scheduler/scheduler.h
浏览文件 @
dc3ecc0a
...
...
@@ -75,6 +75,12 @@ int32_t scheduleExecJob(void *transport, SArray *nodeList, SQueryDag* pDag, void
*/
int32_t
scheduleAsyncExecJob
(
void
*
transport
,
SArray
*
nodeList
,
SQueryDag
*
pDag
,
void
**
pJob
);
/**
* Fetch query result from the remote query executor
* @param pJob
* @param data
* @return
*/
int32_t
scheduleFetchRows
(
void
*
pJob
,
void
**
data
);
...
...
@@ -85,6 +91,10 @@ int32_t scheduleFetchRows(void *pJob, void **data);
*/
int32_t
scheduleCancelJob
(
void
*
pJob
);
/**
* Free the query job
* @param pJob
*/
void
scheduleFreeJob
(
void
*
pJob
);
void
schedulerDestroy
(
void
);
...
...
source/client/inc/clientInt.h
浏览文件 @
dc3ecc0a
...
...
@@ -62,6 +62,7 @@ typedef struct SAppInstInfo {
SList
*
pConnList
;
// STscObj linked list
int64_t
clusterId
;
void
*
pTransporter
;
SHeartBeatInfo
hb
;
}
SAppInstInfo
;
typedef
struct
SAppInfo
{
...
...
@@ -70,7 +71,7 @@ typedef struct SAppInfo {
char
*
ep
;
int32_t
pid
;
int32_t
numOfThreads
;
SHeartBeatInfo
hb
;
SHashObj
*
pInstMap
;
}
SAppInfo
;
...
...
source/libs/parser/src/dCDAstProcess.c
浏览文件 @
dc3ecc0a
#include <astGenerator.h>
#include <tmsg.h>
#include "astToMsg.h"
#include "tmsg.h"
#include "tglobal.h"
#include "parserInt.h"
#include "ttime.h"
#include "astToMsg.h"
#include "astGenerator.h"
#include "parserUtil.h"
#include "queryInfoUtil.h"
#include "tglobal.h"
#include "tmsg.h"
#include "ttime.h"
/* is contained in pFieldList or not */
static
bool
has
(
SArray
*
pFieldList
,
int32_t
startIndex
,
const
char
*
name
)
{
...
...
source/libs/parser/src/insertParser.c
浏览文件 @
dc3ecc0a
...
...
@@ -629,7 +629,6 @@ int32_t parseInsertSql(SParseContext* pContext, SVnodeModifOpStmtInfo** pInfo) {
*
pInfo
=
context
.
pOutput
;
context
.
pOutput
->
nodeType
=
TSDB_SQL_INSERT
;
context
.
pOutput
->
schemaAttache
=
pContext
->
schemaAttached
;
context
.
pOutput
->
payloadType
=
PAYLOAD_TYPE_KV
;
int32_t
code
=
skipInsertInto
(
&
context
);
...
...
source/libs/parser/src/parser.c
浏览文件 @
dc3ecc0a
...
...
@@ -31,8 +31,8 @@ bool isInsertSql(const char* pStr, size_t length) {
}
while
(
1
);
}
bool
qIsDdlQuery
(
const
SQueryNode
*
pQuery
)
{
return
TSDB_SQL_INSERT
!=
pQuery
->
type
&&
TSDB_SQL_SELECT
!=
pQuery
->
type
&&
TSDB_SQL_CREATE_TABLE
!=
pQuery
->
type
;
bool
qIsDdlQuery
(
const
SQueryNode
*
pQuery
Node
)
{
return
TSDB_SQL_INSERT
!=
pQuery
Node
->
type
&&
TSDB_SQL_SELECT
!=
pQueryNode
->
type
&&
TSDB_SQL_CREATE_TABLE
!=
pQueryNode
->
type
;
}
int32_t
parseQuerySql
(
SParseContext
*
pCxt
,
SQueryNode
**
pQuery
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录