未验证 提交 7e7ee57c 编写于 作者: X Xiaoyu Wang 提交者: GitHub

Merge pull request #10693 from taosdata/feature/3.0_query_integrate_wxy

TD-13747 show mnodes
...@@ -87,7 +87,7 @@ tests/comparisonTest/opentsdb/opentsdbtest/.settings/ ...@@ -87,7 +87,7 @@ tests/comparisonTest/opentsdb/opentsdbtest/.settings/
tests/examples/JDBC/JDBCDemo/.classpath tests/examples/JDBC/JDBCDemo/.classpath
tests/examples/JDBC/JDBCDemo/.project tests/examples/JDBC/JDBCDemo/.project
tests/examples/JDBC/JDBCDemo/.settings/ tests/examples/JDBC/JDBCDemo/.settings/
source/libs/parser/inc/new_sql.* source/libs/parser/inc/sql.*
# Emacs # Emacs
# -*- mode: gitignore; -*- # -*- mode: gitignore; -*-
......
...@@ -101,54 +101,55 @@ ...@@ -101,54 +101,55 @@
#define TK_VARBINARY 83 #define TK_VARBINARY 83
#define TK_DECIMAL 84 #define TK_DECIMAL 84
#define TK_SMA 85 #define TK_SMA 85
#define TK_NK_FLOAT 86 #define TK_MNODES 86
#define TK_NK_BOOL 87 #define TK_NK_FLOAT 87
#define TK_NK_VARIABLE 88 #define TK_NK_BOOL 88
#define TK_BETWEEN 89 #define TK_NK_VARIABLE 89
#define TK_IS 90 #define TK_BETWEEN 90
#define TK_NULL 91 #define TK_IS 91
#define TK_NK_LT 92 #define TK_NULL 92
#define TK_NK_GT 93 #define TK_NK_LT 93
#define TK_NK_LE 94 #define TK_NK_GT 94
#define TK_NK_GE 95 #define TK_NK_LE 95
#define TK_NK_NE 96 #define TK_NK_GE 96
#define TK_NK_EQ 97 #define TK_NK_NE 97
#define TK_LIKE 98 #define TK_NK_EQ 98
#define TK_MATCH 99 #define TK_LIKE 99
#define TK_NMATCH 100 #define TK_MATCH 100
#define TK_IN 101 #define TK_NMATCH 101
#define TK_FROM 102 #define TK_IN 102
#define TK_AS 103 #define TK_FROM 103
#define TK_JOIN 104 #define TK_AS 104
#define TK_ON 105 #define TK_JOIN 105
#define TK_INNER 106 #define TK_ON 106
#define TK_SELECT 107 #define TK_INNER 107
#define TK_DISTINCT 108 #define TK_SELECT 108
#define TK_WHERE 109 #define TK_DISTINCT 109
#define TK_PARTITION 110 #define TK_WHERE 110
#define TK_BY 111 #define TK_PARTITION 111
#define TK_SESSION 112 #define TK_BY 112
#define TK_STATE_WINDOW 113 #define TK_SESSION 113
#define TK_INTERVAL 114 #define TK_STATE_WINDOW 114
#define TK_SLIDING 115 #define TK_INTERVAL 115
#define TK_FILL 116 #define TK_SLIDING 116
#define TK_VALUE 117 #define TK_FILL 117
#define TK_NONE 118 #define TK_VALUE 118
#define TK_PREV 119 #define TK_NONE 119
#define TK_LINEAR 120 #define TK_PREV 120
#define TK_NEXT 121 #define TK_LINEAR 121
#define TK_GROUP 122 #define TK_NEXT 122
#define TK_HAVING 123 #define TK_GROUP 123
#define TK_ORDER 124 #define TK_HAVING 124
#define TK_SLIMIT 125 #define TK_ORDER 125
#define TK_SOFFSET 126 #define TK_SLIMIT 126
#define TK_LIMIT 127 #define TK_SOFFSET 127
#define TK_OFFSET 128 #define TK_LIMIT 128
#define TK_ASC 129 #define TK_OFFSET 129
#define TK_DESC 130 #define TK_ASC 130
#define TK_NULLS 131 #define TK_DESC 131
#define TK_FIRST 132 #define TK_NULLS 132
#define TK_LAST 133 #define TK_FIRST 133
#define TK_LAST 134
#define TK_NK_SPACE 300 #define TK_NK_SPACE 300
#define TK_NK_COMMENT 301 #define TK_NK_COMMENT 301
......
...@@ -92,6 +92,7 @@ typedef enum ENodeType { ...@@ -92,6 +92,7 @@ typedef enum ENodeType {
QUERY_NODE_DROP_DNODE_STMT, QUERY_NODE_DROP_DNODE_STMT,
QUERY_NODE_SHOW_DNODES_STMT, QUERY_NODE_SHOW_DNODES_STMT,
QUERY_NODE_SHOW_VGROUPS_STMT, QUERY_NODE_SHOW_VGROUPS_STMT,
QUERY_NODE_SHOW_MNODES_STMT,
// logic plan node // logic plan node
QUERY_NODE_LOGIC_PLAN_SCAN, QUERY_NODE_LOGIC_PLAN_SCAN,
......
...@@ -120,6 +120,7 @@ SNodeptr nodesMakeNode(ENodeType type) { ...@@ -120,6 +120,7 @@ SNodeptr nodesMakeNode(ENodeType type) {
case QUERY_NODE_SHOW_DNODES_STMT: case QUERY_NODE_SHOW_DNODES_STMT:
return makeNode(type, sizeof(SShowStmt)); return makeNode(type, sizeof(SShowStmt));
case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_VGROUPS_STMT:
case QUERY_NODE_SHOW_MNODES_STMT:
return makeNode(type, sizeof(SShowStmt)); return makeNode(type, sizeof(SShowStmt));
case QUERY_NODE_LOGIC_PLAN_SCAN: case QUERY_NODE_LOGIC_PLAN_SCAN:
return makeNode(type, sizeof(SScanLogicNode)); return makeNode(type, sizeof(SScanLogicNode));
......
...@@ -198,6 +198,9 @@ col_name(A) ::= column_name(B). ...@@ -198,6 +198,9 @@ col_name(A) ::= column_name(B).
cmd ::= SHOW VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); } cmd ::= SHOW VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, NULL); }
cmd ::= SHOW db_name(B) NK_DOT VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &B); } cmd ::= SHOW db_name(B) NK_DOT VGROUPS. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, &B); }
/************************************************ show vgroups ********************************************************/
cmd ::= SHOW MNODES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL); }
/************************************************ select **************************************************************/ /************************************************ select **************************************************************/
cmd ::= query_expression(A). { pCxt->pRootNode = A; } cmd ::= query_expression(A). { pCxt->pRootNode = A; }
......
...@@ -81,6 +81,7 @@ static SKeyword keywordTable[] = { ...@@ -81,6 +81,7 @@ static SKeyword keywordTable[] = {
{"MAXROWS", TK_MAXROWS}, {"MAXROWS", TK_MAXROWS},
{"MINROWS", TK_MINROWS}, {"MINROWS", TK_MINROWS},
{"MINUS", TK_MINUS}, {"MINUS", TK_MINUS},
{"MNODES", TK_MNODES},
{"NCHAR", TK_NCHAR}, {"NCHAR", TK_NCHAR},
{"NMATCH", TK_NMATCH}, {"NMATCH", TK_NMATCH},
{"NONE", TK_NONE}, {"NONE", TK_NONE},
...@@ -153,7 +154,6 @@ static SKeyword keywordTable[] = { ...@@ -153,7 +154,6 @@ static SKeyword keywordTable[] = {
// {"UMINUS", TK_UMINUS}, // {"UMINUS", TK_UMINUS},
// {"UPLUS", TK_UPLUS}, // {"UPLUS", TK_UPLUS},
// {"BITNOT", TK_BITNOT}, // {"BITNOT", TK_BITNOT},
// {"MNODES", TK_MNODES},
// {"ACCOUNTS", TK_ACCOUNTS}, // {"ACCOUNTS", TK_ACCOUNTS},
// {"MODULES", TK_MODULES}, // {"MODULES", TK_MODULES},
// {"QUERIES", TK_QUERIES}, // {"QUERIES", TK_QUERIES},
......
...@@ -1062,6 +1062,8 @@ static int32_t nodeTypeToShowType(ENodeType nt) { ...@@ -1062,6 +1062,8 @@ static int32_t nodeTypeToShowType(ENodeType nt) {
return TSDB_MGMT_TABLE_DNODE; return TSDB_MGMT_TABLE_DNODE;
case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_VGROUPS_STMT:
return TSDB_MGMT_TABLE_VGROUP; return TSDB_MGMT_TABLE_VGROUP;
case QUERY_NODE_SHOW_MNODES_STMT:
return TSDB_MGMT_TABLE_MNODE;
default: default:
break; break;
} }
...@@ -1169,6 +1171,7 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) { ...@@ -1169,6 +1171,7 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
case QUERY_NODE_SHOW_USERS_STMT: case QUERY_NODE_SHOW_USERS_STMT:
case QUERY_NODE_SHOW_DNODES_STMT: case QUERY_NODE_SHOW_DNODES_STMT:
case QUERY_NODE_SHOW_VGROUPS_STMT: case QUERY_NODE_SHOW_VGROUPS_STMT:
case QUERY_NODE_SHOW_MNODES_STMT:
code = translateShow(pCxt, (SShowStmt*)pNode); code = translateShow(pCxt, (SShowStmt*)pNode);
break; break;
case QUERY_NODE_SHOW_TABLES_STMT: case QUERY_NODE_SHOW_TABLES_STMT:
......
此差异已折叠。
...@@ -48,6 +48,13 @@ extern "C" { ...@@ -48,6 +48,13 @@ extern "C" {
} \ } \
} while (0) } while (0)
#define planFatal(param, ...) qFatal("PLAN: " param, __VA_ARGS__)
#define planError(param, ...) qError("PLAN: " param, __VA_ARGS__)
#define planWarn(param, ...) qWarn("PLAN: " param, __VA_ARGS__)
#define planInfo(param, ...) qInfo("PLAN: " param, __VA_ARGS__)
#define planDebug(param, ...) qDebug("PLAN: " param, __VA_ARGS__)
#define planTrace(param, ...) qTrace("PLAN: " param, __VA_ARGS__)
int32_t createLogicPlan(SPlanContext* pCxt, SLogicNode** pLogicNode); int32_t createLogicPlan(SPlanContext* pCxt, SLogicNode** pLogicNode);
int32_t optimize(SPlanContext* pCxt, SLogicNode* pLogicNode); int32_t optimize(SPlanContext* pCxt, SLogicNode* pLogicNode);
int32_t applySplitRule(SSubLogicPlan* pSubplan); int32_t applySplitRule(SSubLogicPlan* pSubplan);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册