This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch ty/object_type in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 70eee3a37ee3e6b852e7e31f2565f202f5720d30 Author: Caideyipi <[email protected]> AuthorDate: Wed Nov 26 18:00:01 2025 +0800 Fixed the bug of 305 error for unsupported table opreations #16816 (cherry picked from commit fb899b16b92656b9c17dc46d026ec7bea45d8350) --- .../apache/iotdb/relational/it/schema/IoTDBTableIT.java | 16 ++++++++++++++++ .../plan/relational/sql/ast/RenameColumn.java | 5 +++-- .../queryengine/plan/relational/sql/ast/RenameTable.java | 5 +++-- 3 files changed, 22 insertions(+), 4 deletions(-) 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 54881fb8293..c1c421ce57f 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 @@ -150,6 +150,22 @@ public class IoTDBTableIT { assertEquals(tableNames.length, cnt); } + // Test unsupported, to be deleted + try { + statement.execute("alter table test1.table1 rename to tableN"); + } catch (final SQLException e) { + assertEquals("701: The renaming for base table is currently unsupported", e.getMessage()); + } + + // Test unsupported, to be deleted + try { + statement.execute( + "alter table if exists test_db.table1 rename column if exists model to modelType"); + } catch (final SQLException e) { + assertEquals( + "701: The renaming for base table column is currently unsupported", e.getMessage()); + } + // Alter table properties statement.execute("alter table test1.table1 set properties ttl=1000000"); ttls = new String[] {"1000000"}; diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameColumn.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameColumn.java index 0bcc8d5bbae..d0fbf1ed320 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameColumn.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameColumn.java @@ -19,6 +19,8 @@ package org.apache.iotdb.db.queryengine.plan.relational.sql.ast; +import org.apache.iotdb.db.exception.sql.SemanticException; + import com.google.common.collect.ImmutableList; import java.util.List; @@ -52,8 +54,7 @@ public final class RenameColumn extends Statement { this.columnIfNotExists = columnIfNotExists; this.view = view; if (!view) { - throw new UnsupportedOperationException( - "The renaming for base table column is currently unsupported"); + throw new SemanticException("The renaming for base table column is currently unsupported"); } } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameTable.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameTable.java index 69c2b18e96d..4a181f99bba 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameTable.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/RenameTable.java @@ -19,6 +19,8 @@ package org.apache.iotdb.db.queryengine.plan.relational.sql.ast; +import org.apache.iotdb.db.exception.sql.SemanticException; + import com.google.common.collect.ImmutableList; import java.util.List; @@ -46,8 +48,7 @@ public class RenameTable extends Statement { this.tableIfExists = tableIfExists; this.view = view; if (!view) { - throw new UnsupportedOperationException( - "The renaming for base table is currently unsupported"); + throw new SemanticException("The renaming for base table is currently unsupported"); } }
