This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new c77bb57cb2e Optimized the error message & prevented stack printing of 
information_schema selection when the cluster is closing (#16905)
c77bb57cb2e is described below

commit c77bb57cb2e9e99f2511c7bb59894773f873b720
Author: Caideyipi <[email protected]>
AuthorDate: Tue Dec 16 09:16:11 2025 +0800

    Optimized the error message & prevented stack printing of 
information_schema selection when the cluster is closing (#16905)
    
    * DL
    
    * ancient-IT
---
 .../java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java  | 6 ++++++
 .../planner/distribute/TableDistributedPlanGenerator.java         | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java
index c1c421ce57f..753ff5fa42b 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java
@@ -1098,6 +1098,12 @@ public class IoTDBTableIT {
       } catch (final SQLException e) {
         assertEquals("701: The system view does not support show create.", 
e.getMessage());
       }
+      try {
+        statement.execute("show create table information_schema.tables");
+        fail();
+      } catch (final SQLException e) {
+        assertEquals("701: The system view does not support show create.", 
e.getMessage());
+      }
       try {
         statement.execute("create or replace view a () as root.b.**");
         fail();
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
index 069d1df7469..e13d09de4a5 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
@@ -23,6 +23,7 @@ import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
 import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
 import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
+import org.apache.iotdb.commons.exception.IoTDBRuntimeException;
 import org.apache.iotdb.commons.partition.DataPartition;
 import org.apache.iotdb.commons.partition.SchemaPartition;
 import org.apache.iotdb.commons.schema.table.TsTable;
@@ -100,6 +101,7 @@ import 
org.apache.iotdb.db.queryengine.plan.relational.sql.ast.SymbolReference;
 import org.apache.iotdb.db.queryengine.plan.statement.component.Ordering;
 import org.apache.iotdb.db.schemaengine.table.DataNodeTableCache;
 import org.apache.iotdb.db.schemaengine.table.DataNodeTreeViewSchemaUtils;
+import org.apache.iotdb.rpc.TSStatusCode;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableListMultimap;
@@ -1004,7 +1006,11 @@ public class TableDistributedPlanGenerator
     List<TDataNodeLocation> dataNodeLocations =
         dataNodeLocationSupplier.getDataNodeLocations(
             node.getQualifiedObjectName().getObjectName());
-    checkArgument(!dataNodeLocations.isEmpty(), "DataNodeLocations shouldn't 
be empty");
+    if (dataNodeLocations.isEmpty()) {
+      throw new IoTDBRuntimeException(
+          "No available dataNodes, may be the cluster is closing",
+          TSStatusCode.NO_AVAILABLE_REPLICA.getStatusCode());
+    }
 
     List<PlanNode> resultTableScanNodeList = new ArrayList<>();
     dataNodeLocations.forEach(

Reply via email to