This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch 305-fix
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/305-fix by this push:
new 13aa1be0d9a fix
13aa1be0d9a is described below
commit 13aa1be0d9a0795d2d3b28d5492d1a7b0b775bd6
Author: Caideyipi <[email protected]>
AuthorDate: Wed Nov 26 16:32:35 2025 +0800
fix
---
.../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");
}
}