You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2024/07/19 06:56:02 UTC
(iotdb) branch ty/TableModelGrammar updated: Feat/table support show cluster regions datanodes confignodes (#12852)
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch ty/TableModelGrammar
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/ty/TableModelGrammar by this push:
new 002d779e68c Feat/table support show cluster regions datanodes confignodes (#12852)
002d779e68c is described below
commit 002d779e68cd002dffd731052dce80d445871f03
Author: Christofer Dutz <cd...@apache.org>
AuthorDate: Fri Jul 19 08:55:56 2024 +0200
Feat/table support show cluster regions datanodes confignodes (#12852)
---
.../protocol/thrift/impl/ClientRPCServiceImpl.java | 5 +-
.../iotdb/db/queryengine/plan/Coordinator.java | 14 ++-
.../execution/config/TableConfigTaskVisitor.java | 45 +++++++++
...TaskVisitor.java => TreeConfigTaskVisitor.java} | 2 +-
.../config/executor/ClusterConfigTaskExecutor.java | 67 ++++++++++++++
.../config/executor/IConfigTaskExecutor.java | 12 +++
.../metadata/relational/ShowConfigNodesTask.java | 80 ++++++++++++++++
.../metadata/relational/ShowDataNodesTask.java | 85 +++++++++++++++++
.../plan/relational/sql/ast/AstVisitor.java | 16 ++++
.../plan/relational/sql/ast/ShowCluster.java | 90 ++++++++++++++++++
.../plan/relational/sql/ast/ShowConfigNodes.java | 66 +++++++++++++
.../plan/relational/sql/ast/ShowDataNodes.java | 66 +++++++++++++
.../plan/relational/sql/ast/ShowRegions.java | 103 +++++++++++++++++++++
.../plan/relational/sql/parser/AstBuilder.java | 37 +++++++-
.../db/relational/grammar/sql/RelationalSql.g4 | 4 +-
15 files changed, 681 insertions(+), 11 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
index 4187aadb8dc..13d6e9d4216 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
@@ -354,9 +354,12 @@ public class ClientRPCServiceImpl implements IClientRPCServiceWithHandler {
TSStatusCode.SQL_PARSE_ERROR, "This operation type is not supported"));
}
- queryId = SESSION_MANAGER.requestQueryId(clientSession, req.statementId);
+ // TODO: permission check
// TODO audit log, quota, StatementType
+
+ queryId = SESSION_MANAGER.requestQueryId(clientSession, req.statementId);
+
result =
COORDINATOR.executeForTableModel(
s,
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
index 4a79cad8b27..a036d886e77 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
@@ -43,8 +43,8 @@ import org.apache.iotdb.db.queryengine.plan.execution.ExecutionResult;
import org.apache.iotdb.db.queryengine.plan.execution.IQueryExecution;
import org.apache.iotdb.db.queryengine.plan.execution.QueryExecution;
import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigExecution;
-import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskVisitor;
import org.apache.iotdb.db.queryengine.plan.execution.config.TableConfigTaskVisitor;
+import org.apache.iotdb.db.queryengine.plan.execution.config.TreeConfigTaskVisitor;
import org.apache.iotdb.db.queryengine.plan.planner.TreeModelPlanner;
import org.apache.iotdb.db.queryengine.plan.relational.metadata.Metadata;
import org.apache.iotdb.db.queryengine.plan.relational.planner.RelationalModelPlanner;
@@ -53,7 +53,11 @@ import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.CreateTable;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.DescribeTable;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.DropDB;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.DropTable;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDataNodes;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowRegions;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowTables;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Use;
import org.apache.iotdb.db.queryengine.plan.relational.sql.parser.SqlParser;
@@ -217,7 +221,7 @@ public class Coordinator {
queryContext,
statement.getType(),
executor,
- statement.accept(new ConfigTaskVisitor(), queryContext));
+ statement.accept(new TreeConfigTaskVisitor(), queryContext));
}
TreeModelPlanner treeModelPlanner =
new TreeModelPlanner(
@@ -273,7 +277,11 @@ public class Coordinator {
|| statement instanceof CreateTable
|| statement instanceof DescribeTable
|| statement instanceof ShowTables
- || statement instanceof DropTable) {
+ || statement instanceof DropTable
+ || statement instanceof ShowCluster
+ || statement instanceof ShowRegions
+ || statement instanceof ShowDataNodes
+ || statement instanceof ShowConfigNodes) {
return new ConfigExecution(
queryContext,
null,
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
index e05a2d740ba..d2024cadc39 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
@@ -25,11 +25,15 @@ import org.apache.iotdb.db.exception.sql.SemanticException;
import org.apache.iotdb.db.protocol.session.IClientSession;
import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
import org.apache.iotdb.db.queryengine.plan.analyze.QueryType;
+import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowClusterTask;
+import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.ShowRegionTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.CreateDBTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.CreateTableTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.DescribeTableTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.DropDBTask;
+import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.ShowConfigNodesTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.ShowDBTask;
+import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.ShowDataNodesTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.ShowTablesTask;
import org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational.UseDBTask;
import org.apache.iotdb.db.queryengine.plan.relational.metadata.Metadata;
@@ -47,10 +51,16 @@ import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Expression;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.LongLiteral;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Node;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Property;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDataNodes;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowRegions;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowTables;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Use;
import org.apache.iotdb.db.queryengine.plan.relational.type.TypeNotFoundException;
+import org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowClusterStatement;
+import org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowRegionStatement;
import org.apache.tsfile.enums.TSDataType;
@@ -105,6 +115,41 @@ public class TableConfigTaskVisitor extends AstVisitor<IConfigTask, MPPQueryCont
return new ShowDBTask(node);
}
+ @Override
+ protected IConfigTask visitShowCluster(ShowCluster showCluster, MPPQueryContext context) {
+ context.setQueryType(QueryType.READ);
+ // As the implementation is identical, we'll simply translate to the
+ // corresponding tree-model variant and execute that.
+ ShowClusterStatement treeStatement = new ShowClusterStatement();
+ treeStatement.setDetails(showCluster.getDetails().orElse(false));
+ return new ShowClusterTask(treeStatement);
+ }
+
+ @Override
+ protected IConfigTask visitShowRegions(ShowRegions showRegions, MPPQueryContext context) {
+ context.setQueryType(QueryType.READ);
+ // As the implementation is identical, we'll simply translate to the
+ // corresponding tree-model variant and execute that.
+ ShowRegionStatement treeStatement = new ShowRegionStatement();
+ treeStatement.setRegionType(showRegions.getRegionType());
+ treeStatement.setStorageGroups(showRegions.getDatabases());
+ treeStatement.setNodeIds(showRegions.getNodeIds());
+ return new ShowRegionTask(treeStatement);
+ }
+
+ @Override
+ protected IConfigTask visitShowDataNodes(
+ ShowDataNodes showDataNodesStatement, MPPQueryContext context) {
+ context.setQueryType(QueryType.READ);
+ return new ShowDataNodesTask(showDataNodesStatement);
+ }
+
+ protected IConfigTask visitShowConfigNodes(
+ ShowConfigNodes showConfigNodesStatement, MPPQueryContext context) {
+ context.setQueryType(QueryType.READ);
+ return new ShowConfigNodesTask(showConfigNodesStatement);
+ }
+
@Override
protected IConfigTask visitCreateTable(final CreateTable node, final MPPQueryContext context) {
context.setQueryType(QueryType.WRITE);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/ConfigTaskVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
similarity index 99%
rename from iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/ConfigTaskVisitor.java
rename to iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
index e9b36c80c91..1704d034b01 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/ConfigTaskVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TreeConfigTaskVisitor.java
@@ -163,7 +163,7 @@ import org.apache.iotdb.db.queryengine.plan.statement.sys.quota.ShowThrottleQuot
import org.apache.tsfile.exception.NotImplementedException;
-public class ConfigTaskVisitor extends StatementVisitor<IConfigTask, MPPQueryContext> {
+public class TreeConfigTaskVisitor extends StatementVisitor<IConfigTask, MPPQueryContext> {
@Override
public IConfigTask visitNode(StatementNode node, MPPQueryContext context) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index aebd1792034..71f4f12df8e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -174,7 +174,11 @@ import org.apache.iotdb.db.queryengine.plan.expression.visitor.TransformToViewEx
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.metedata.write.view.AlterLogicalViewNode;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.CreateDB;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.DropDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDataNodes;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowRegions;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Use;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.CountDatabaseStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.CountTimeSlotListStatement;
@@ -2790,6 +2794,69 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
return future;
}
+ @Override
+ public SettableFuture<ConfigTaskResult> showCluster(ShowCluster showCluster) {
+ // As the implementation is identical, we'll simply translate to the
+ // corresponding tree-model variant and execute that.
+ ShowClusterStatement treeStatement = new ShowClusterStatement();
+ treeStatement.setDetails(showCluster.getDetails().orElse(false));
+ return showCluster(treeStatement);
+ }
+
+ @Override
+ public SettableFuture<ConfigTaskResult> showRegions(ShowRegions showRegions) {
+ // As the implementation is identical, we'll simply translate to the
+ // corresponding tree-model variant and execute that.
+ ShowRegionStatement treeStatement = new ShowRegionStatement();
+ treeStatement.setRegionType(showRegions.getRegionType());
+ treeStatement.setStorageGroups(showRegions.getDatabases());
+ treeStatement.setNodeIds(showRegions.getNodeIds());
+ return showRegion(treeStatement);
+ }
+
+ @Override
+ public SettableFuture<ConfigTaskResult> showDataNodes(ShowDataNodes showDataNodes) {
+ SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+ TShowDataNodesResp showDataNodesResp = new TShowDataNodesResp();
+ try (ConfigNodeClient client =
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+ showDataNodesResp = client.showDataNodes();
+ if (showDataNodesResp.getStatus().getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+ future.setException(
+ new IoTDBException(
+ showDataNodesResp.getStatus().message, showDataNodesResp.getStatus().code));
+ return future;
+ }
+ } catch (ClientManagerException | TException e) {
+ future.setException(e);
+ }
+ // build TSBlock
+ ShowDataNodesTask.buildTSBlock(showDataNodesResp, future);
+ return future;
+ }
+
+ @Override
+ public SettableFuture<ConfigTaskResult> showConfigNodes(ShowConfigNodes showConfigNodes) {
+ SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+ TShowConfigNodesResp showConfigNodesResp = new TShowConfigNodesResp();
+ try (ConfigNodeClient client =
+ CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+ showConfigNodesResp = client.showConfigNodes();
+ if (showConfigNodesResp.getStatus().getCode()
+ != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+ future.setException(
+ new IoTDBException(
+ showConfigNodesResp.getStatus().message, showConfigNodesResp.getStatus().code));
+ return future;
+ }
+ } catch (ClientManagerException | TException e) {
+ future.setException(e);
+ }
+ // build TSBlock
+ ShowConfigNodesTask.buildTSBlock(showConfigNodesResp, future);
+ return future;
+ }
+
@Override
public SettableFuture<ConfigTaskResult> useDatabase(Use useDB, IClientSession clientSession) {
SettableFuture<ConfigTaskResult> future = SettableFuture.create();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
index e43111a7b92..954f74f3897 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/IConfigTaskExecutor.java
@@ -33,7 +33,11 @@ import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
import org.apache.iotdb.db.queryengine.plan.planner.plan.node.metedata.write.view.AlterLogicalViewNode;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.CreateDB;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.DropDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDataNodes;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowRegions;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Use;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.CountDatabaseStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.CountTimeSlotListStatement;
@@ -258,6 +262,14 @@ public interface IConfigTaskExecutor {
SettableFuture<ConfigTaskResult> showDatabases(ShowDB showDB);
+ SettableFuture<ConfigTaskResult> showCluster(ShowCluster showCluster);
+
+ SettableFuture<ConfigTaskResult> showRegions(ShowRegions showRegions);
+
+ SettableFuture<ConfigTaskResult> showDataNodes(ShowDataNodes showDataNodes);
+
+ SettableFuture<ConfigTaskResult> showConfigNodes(ShowConfigNodes showConfigNodes);
+
SettableFuture<ConfigTaskResult> useDatabase(Use useDB, IClientSession clientSession);
SettableFuture<ConfigTaskResult> dropDatabase(DropDB dropDB);
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowConfigNodesTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowConfigNodesTask.java
new file mode 100644
index 00000000000..5b0ac00068d
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowConfigNodesTask.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational;
+
+import org.apache.iotdb.confignode.rpc.thrift.TConfigNodeInfo;
+import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
+import org.apache.iotdb.db.queryengine.common.header.ColumnHeader;
+import org.apache.iotdb.db.queryengine.common.header.ColumnHeaderConstant;
+import org.apache.iotdb.db.queryengine.common.header.DatasetHeader;
+import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory;
+import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
+import org.apache.iotdb.db.queryengine.plan.execution.config.IConfigTask;
+import org.apache.iotdb.db.queryengine.plan.execution.config.executor.IConfigTaskExecutor;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
+import org.apache.iotdb.rpc.TSStatusCode;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
+import org.apache.tsfile.enums.TSDataType;
+import org.apache.tsfile.read.common.block.TsBlockBuilder;
+import org.apache.tsfile.utils.BytesUtils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ShowConfigNodesTask implements IConfigTask {
+
+ private final ShowConfigNodes showConfigNodes;
+
+ public ShowConfigNodesTask(ShowConfigNodes showConfigNodes) {
+ this.showConfigNodes = showConfigNodes;
+ }
+
+ @Override
+ public ListenableFuture<ConfigTaskResult> execute(IConfigTaskExecutor configTaskExecutor)
+ throws InterruptedException {
+ return configTaskExecutor.showConfigNodes(showConfigNodes);
+ }
+
+ public static void buildTSBlock(
+ TShowConfigNodesResp showConfigNodesResp, SettableFuture<ConfigTaskResult> future) {
+ List<TSDataType> outputDataTypes =
+ ColumnHeaderConstant.showConfigNodesColumnHeaders.stream()
+ .map(ColumnHeader::getColumnType)
+ .collect(Collectors.toList());
+ TsBlockBuilder builder = new TsBlockBuilder(outputDataTypes);
+ if (showConfigNodesResp.getConfigNodesInfoList() != null) {
+ for (TConfigNodeInfo configNodeInfo : showConfigNodesResp.getConfigNodesInfoList()) {
+ builder.getTimeColumnBuilder().writeLong(0L);
+ builder.getColumnBuilder(0).writeInt(configNodeInfo.getConfigNodeId());
+ builder.getColumnBuilder(1).writeBinary(BytesUtils.valueOf(configNodeInfo.getStatus()));
+ builder
+ .getColumnBuilder(2)
+ .writeBinary(BytesUtils.valueOf(configNodeInfo.getInternalAddress()));
+ builder.getColumnBuilder(3).writeInt(configNodeInfo.getInternalPort());
+ builder.getColumnBuilder(4).writeBinary(BytesUtils.valueOf(configNodeInfo.getRoleType()));
+ builder.declarePosition();
+ }
+ }
+ DatasetHeader datasetHeader = DatasetHeaderFactory.getShowConfigNodesHeader();
+ future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS, builder.build(), datasetHeader));
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowDataNodesTask.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowDataNodesTask.java
new file mode 100644
index 00000000000..1ea2533296f
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowDataNodesTask.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.execution.config.metadata.relational;
+
+import org.apache.iotdb.confignode.rpc.thrift.TDataNodeInfo;
+import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
+import org.apache.iotdb.db.queryengine.common.header.ColumnHeader;
+import org.apache.iotdb.db.queryengine.common.header.ColumnHeaderConstant;
+import org.apache.iotdb.db.queryengine.common.header.DatasetHeader;
+import org.apache.iotdb.db.queryengine.common.header.DatasetHeaderFactory;
+import org.apache.iotdb.db.queryengine.plan.execution.config.ConfigTaskResult;
+import org.apache.iotdb.db.queryengine.plan.execution.config.IConfigTask;
+import org.apache.iotdb.db.queryengine.plan.execution.config.executor.IConfigTaskExecutor;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDataNodes;
+import org.apache.iotdb.rpc.TSStatusCode;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
+import org.apache.tsfile.enums.TSDataType;
+import org.apache.tsfile.read.common.block.TsBlockBuilder;
+import org.apache.tsfile.utils.BytesUtils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class ShowDataNodesTask implements IConfigTask {
+
+ private final ShowDataNodes showDataNodes;
+
+ public ShowDataNodesTask(ShowDataNodes showDataNodes) {
+ this.showDataNodes = showDataNodes;
+ }
+
+ @Override
+ public ListenableFuture<ConfigTaskResult> execute(IConfigTaskExecutor configTaskExecutor)
+ throws InterruptedException {
+ return configTaskExecutor.showDataNodes(showDataNodes);
+ }
+
+ public static void buildTSBlock(
+ TShowDataNodesResp showDataNodesResp, SettableFuture<ConfigTaskResult> future) {
+ List<TSDataType> outputDataTypes =
+ ColumnHeaderConstant.showDataNodesColumnHeaders.stream()
+ .map(ColumnHeader::getColumnType)
+ .collect(Collectors.toList());
+ TsBlockBuilder builder = new TsBlockBuilder(outputDataTypes);
+ if (showDataNodesResp.getDataNodesInfoList() != null) {
+ for (TDataNodeInfo dataNodeInfo : showDataNodesResp.getDataNodesInfoList()) {
+ builder.getTimeColumnBuilder().writeLong(0L);
+ builder.getColumnBuilder(0).writeInt(dataNodeInfo.getDataNodeId());
+ builder
+ .getColumnBuilder(1)
+ .writeBinary(
+ BytesUtils.valueOf(
+ dataNodeInfo.getStatus() == null ? "" : dataNodeInfo.getStatus()));
+
+ builder.getColumnBuilder(2).writeBinary(BytesUtils.valueOf(dataNodeInfo.getRpcAddresss()));
+ builder.getColumnBuilder(3).writeInt(dataNodeInfo.getRpcPort());
+ builder.getColumnBuilder(4).writeInt(dataNodeInfo.getDataRegionNum());
+
+ builder.getColumnBuilder(5).writeInt(dataNodeInfo.getSchemaRegionNum());
+ builder.declarePosition();
+ }
+ }
+ DatasetHeader datasetHeader = DatasetHeaderFactory.getShowDataNodesHeader();
+ future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS, builder.build(), datasetHeader));
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
index d9b54da1f6f..dcf2c6c36d5 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/AstVisitor.java
@@ -331,6 +331,22 @@ public abstract class AstVisitor<R, C> {
return visitStatement(node, context);
}
+ protected R visitShowCluster(ShowCluster node, C context) {
+ return visitStatement(node, context);
+ }
+
+ protected R visitShowRegions(ShowRegions node, C context) {
+ return visitStatement(node, context);
+ }
+
+ protected R visitShowDataNodes(ShowDataNodes node, C context) {
+ return visitStatement(node, context);
+ }
+
+ protected R visitShowConfigNodes(ShowConfigNodes node, C context) {
+ return visitStatement(node, context);
+ }
+
protected R visitRenameTable(RenameTable node, C context) {
return visitStatement(node, context);
}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowCluster.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowCluster.java
new file mode 100644
index 00000000000..d7ea18642b6
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowCluster.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.relational.sql.ast;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static java.util.Objects.requireNonNull;
+
+public class ShowCluster extends Statement {
+
+ private final boolean details;
+
+ public ShowCluster() {
+ super(null);
+ this.details = false;
+ }
+
+ public ShowCluster(NodeLocation location) {
+ super(requireNonNull(location, "location is null"));
+ this.details = false;
+ }
+
+ public ShowCluster(Boolean withDetails) {
+ super(null);
+ this.details = requireNonNull(withDetails, "details is null");
+ }
+
+ public ShowCluster(NodeLocation location, Boolean withDetails) {
+ super(requireNonNull(location, "location is null"));
+ this.details = requireNonNull(withDetails, "details is null");
+ }
+
+ public Optional<Boolean> getDetails() {
+ return Optional.of(details);
+ }
+
+ @Override
+ public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
+ return visitor.visitShowCluster(this, context);
+ }
+
+ @Override
+ public List<Node> getChildren() {
+ return ImmutableList.of();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(details);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if ((obj == null) || (getClass() != obj.getClass())) {
+ return false;
+ }
+ ShowCluster o = (ShowCluster) obj;
+ return Objects.equals(details, o.details);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this).add("details", details).toString();
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowConfigNodes.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowConfigNodes.java
new file mode 100644
index 00000000000..8139789f77b
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowConfigNodes.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.relational.sql.ast;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.List;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static java.util.Objects.requireNonNull;
+
+public class ShowConfigNodes extends Statement {
+
+ public ShowConfigNodes() {
+ super(null);
+ }
+
+ public ShowConfigNodes(NodeLocation location) {
+ super(requireNonNull(location, "location is null"));
+ }
+
+ @Override
+ public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
+ return visitor.visitShowConfigNodes(this, context);
+ }
+
+ @Override
+ public List<Node> getChildren() {
+ return ImmutableList.of();
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ return (obj != null) && (getClass() == obj.getClass());
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this).toString();
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowDataNodes.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowDataNodes.java
new file mode 100644
index 00000000000..c95f5b9cbab
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowDataNodes.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.relational.sql.ast;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.List;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static java.util.Objects.requireNonNull;
+
+public class ShowDataNodes extends Statement {
+
+ public ShowDataNodes() {
+ super(null);
+ }
+
+ public ShowDataNodes(NodeLocation location) {
+ super(requireNonNull(location, "location is null"));
+ }
+
+ @Override
+ public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
+ return visitor.visitShowDataNodes(this, context);
+ }
+
+ @Override
+ public List<Node> getChildren() {
+ return ImmutableList.of();
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ return (obj != null) && (getClass() == obj.getClass());
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this).toString();
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowRegions.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowRegions.java
new file mode 100644
index 00000000000..475dcdb6057
--- /dev/null
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/ShowRegions.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.db.queryengine.plan.relational.sql.ast;
+
+import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
+import org.apache.iotdb.commons.path.PartialPath;
+
+import com.google.common.collect.ImmutableList;
+
+import java.util.List;
+import java.util.Objects;
+
+import static com.google.common.base.MoreObjects.toStringHelper;
+import static java.util.Objects.requireNonNull;
+
+public class ShowRegions extends Statement {
+
+ private final TConsensusGroupType regionType;
+ private final List<PartialPath> databases;
+ private final List<Integer> nodeIds;
+
+ public ShowRegions(
+ TConsensusGroupType regionType, List<PartialPath> databases, List<Integer> nodeIds) {
+ super(null);
+ this.regionType = regionType;
+ this.databases = databases;
+ this.nodeIds = nodeIds;
+ }
+
+ public ShowRegions(
+ NodeLocation location,
+ TConsensusGroupType regionType,
+ List<PartialPath> storageGroups,
+ List<Integer> nodeIds) {
+ super(requireNonNull(location, "location is null"));
+ this.regionType = regionType;
+ this.databases = requireNonNull(storageGroups, "databases is null");
+ this.nodeIds = requireNonNull(nodeIds, "nodeIds is null");
+ }
+
+ public TConsensusGroupType getRegionType() {
+ return regionType;
+ }
+
+ public List<PartialPath> getDatabases() {
+ return databases;
+ }
+
+ public List<Integer> getNodeIds() {
+ return nodeIds;
+ }
+
+ @Override
+ public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
+ return visitor.visitShowRegions(this, context);
+ }
+
+ @Override
+ public List<Node> getChildren() {
+ return ImmutableList.of();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ ShowRegions that = (ShowRegions) o;
+ return regionType == that.regionType
+ && Objects.equals(databases, that.databases)
+ && Objects.equals(nodeIds, that.nodeIds);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(regionType, databases, nodeIds);
+ }
+
+ @Override
+ public String toString() {
+ return toStringHelper(this)
+ .add("regionType", regionType)
+ .add("databases", databases)
+ .add("nodeIds", nodeIds)
+ .toString();
+ }
+}
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
index ef2a3dfe5e8..f69ba470c95 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/parser/AstBuilder.java
@@ -19,6 +19,9 @@
package org.apache.iotdb.db.queryengine.plan.relational.sql.parser;
+import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
+import org.apache.iotdb.commons.exception.IllegalPathException;
+import org.apache.iotdb.commons.path.PartialPath;
import org.apache.iotdb.commons.schema.table.column.TsTableColumnCategory;
import org.apache.iotdb.commons.utils.CommonDateTimeUtils;
import org.apache.iotdb.db.exception.sql.SemanticException;
@@ -101,8 +104,12 @@ import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SearchedCaseExpre
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Select;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SelectItem;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SetProperties;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowCluster;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowConfigNodes;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDB;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowDataNodes;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowIndex;
+import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowRegions;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.ShowTables;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SimpleCaseExpression;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SimpleGroupBy;
@@ -141,6 +148,7 @@ import javax.annotation.Nullable;
import java.time.ZoneId;
import java.util.ArrayDeque;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Deque;
import java.util.Iterator;
import java.util.List;
@@ -409,23 +417,44 @@ public class AstBuilder extends RelationalSqlBaseVisitor<Node> {
@Override
public Node visitShowClusterStatement(RelationalSqlParser.ShowClusterStatementContext ctx) {
- return super.visitShowClusterStatement(ctx);
+ boolean details = ctx.DETAILS() != null;
+ return new ShowCluster(details);
}
@Override
public Node visitShowRegionsStatement(RelationalSqlParser.ShowRegionsStatementContext ctx) {
- return super.visitShowRegionsStatement(ctx);
+ TConsensusGroupType regionType = null;
+ if (ctx.DATA() != null) {
+ regionType = TConsensusGroupType.DataRegion;
+ } else if (ctx.SCHEMA() != null) {
+ regionType = TConsensusGroupType.SchemaRegion;
+ }
+ List<PartialPath> databases = null;
+ if (ctx.identifier() != null) {
+ try {
+ // When using the table model, only single level databases are allowed to be used.
+ // Therefore, the "root." prefix is omitted from the query syntax, but we need to
+ // add it back before querying the server.
+ databases =
+ Collections.singletonList(new PartialPath("root." + ctx.identifier().getText()));
+ } catch (IllegalPathException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ // TODO: This will be left untouched for now, well add filtering later on.
+ List<Integer> nodeIds = null;
+ return new ShowRegions(regionType, databases, nodeIds);
}
@Override
public Node visitShowDataNodesStatement(RelationalSqlParser.ShowDataNodesStatementContext ctx) {
- return super.visitShowDataNodesStatement(ctx);
+ return new ShowDataNodes();
}
@Override
public Node visitShowConfigNodesStatement(
RelationalSqlParser.ShowConfigNodesStatementContext ctx) {
- return super.visitShowConfigNodesStatement(ctx);
+ return new ShowConfigNodes();
}
@Override
diff --git a/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4 b/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
index 4e7d8ebff85..05d2a881735 100644
--- a/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
+++ b/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
@@ -253,8 +253,8 @@ showClusterStatement
;
showRegionsStatement
- : SHOW (SCHEMA | DATA)? REGIONS (OF DATABASE identifier? (',' identifier)*)?
- (ON NODEID INTEGER_VALUE (',' INTEGER_VALUE)*)?
+ : SHOW (SCHEMA | DATA)? REGIONS ((FROM | IN) identifier)?
+ // ((LIKE pattern=string) | (WHERE expression))?
;
showDataNodesStatement