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

Wei-hao-Li pushed a commit to branch fixSetConfig
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3522f041f1275dd2bdb9da1c3043b054178d9b35
Author: Weihao Li <[email protected]>
AuthorDate: Wed Oct 14 09:14:16 2026 +0800

    set
    
    Signed-off-by: Weihao Li <[email protected]>
---
 .../relational/it/db/it/IoTDBSetConfigurationTableIT.java     | 11 +++++++++++
 .../en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java    |  2 ++
 .../zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java    |  2 ++
 .../db/queryengine/plan/relational/sql/parser/AstBuilder.java |  5 +++++
 4 files changed, 20 insertions(+)

diff --git 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBSetConfigurationTableIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBSetConfigurationTableIT.java
index 8a4bc388a59..203b4504471 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBSetConfigurationTableIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBSetConfigurationTableIT.java
@@ -61,6 +61,7 @@ public class IoTDBSetConfigurationTableIT {
   public void testSetConfigurationWithUndefinedConfigKey() {
     String expectedExceptionMsg =
         "301: ignored config items: [a] because they are immutable or 
undefined.";
+    String expectedUnSupportedMsg = "701: DEFAULT is not supported for SET 
CONFIGURATION";
     try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
       executeAndExpectException(statement, "set configuration \"a\"='false'", 
expectedExceptionMsg);
@@ -70,11 +71,21 @@ public class IoTDBSetConfigurationTableIT {
       for (int i = 0; i < configNodeNum; i++) {
         executeAndExpectException(
             statement, "set configuration a=\'false\' on " + i, 
expectedExceptionMsg);
+
+        executeAndExpectException(
+            statement,
+            "set configuration enable_seq_space_compaction=default on " + i,
+            expectedUnSupportedMsg);
       }
       for (int i = 0; i < dataNodeNum; i++) {
         int dnId = configNodeNum + i;
         executeAndExpectException(
             statement, "set configuration \"a\"='false' on " + dnId, 
expectedExceptionMsg);
+
+        executeAndExpectException(
+            statement,
+            "set configuration enable_seq_space_compaction=default on " + dnId,
+            expectedUnSupportedMsg);
       }
     } catch (Exception e) {
       Assert.fail(e.getMessage());
diff --git 
a/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
 
b/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
index 1672c9024f5..7ac9061f57d 100644
--- 
a/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
+++ 
b/iotdb-core/datanode/src/main/i18n/en/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
@@ -2495,6 +2495,8 @@ public final class DataNodeQueryMessages {
       "Inconsistent numbers of non-time column names and values: %d-%d";
   public static final String 
IS_NOT_SUPPORTED_FOR_PROPERTY_VALUE_OF_SET_CONFIGURATION =
       " is not supported for property value of 'set configuration'. ";
+  public static final String 
EXCEPTION_DEFAULT_IS_NOT_SUPPORTED_FOR_SET_CONFIGURATION_D76F13AD =
+      "DEFAULT is not supported for SET CONFIGURATION";
   public static final String 
NOTE_THAT_THE_SYNTAX_FOR_SET_CONFIGURATION_IN_THE_TREE_MODEL_IS_NOT_EXACTLY_THE_SAME_AS
 =
       "Note that the syntax for 'set configuration' in the tree model is not 
exactly the same as that in the table model.";
   public static final String UNSUPPORTED_COPY_TO_FORMAT_S_SUPPORTED_FORMATS_S =
diff --git 
a/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
 
b/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
index 114fc1240ff..f15150d540d 100644
--- 
a/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
+++ 
b/iotdb-core/datanode/src/main/i18n/zh/org/apache/iotdb/db/i18n/DataNodeQueryMessages.java
@@ -2867,6 +2867,8 @@ public final class DataNodeQueryMessages {
   public static final String 
IS_NOT_SUPPORTED_FOR_PROPERTY_VALUE_OF_SET_CONFIGURATION =
 
       " 不支持作为 'set configuration' 的属性值。";
+  public static final String 
EXCEPTION_DEFAULT_IS_NOT_SUPPORTED_FOR_SET_CONFIGURATION_D76F13AD =
+      "DEFAULT 不支持用于 SET CONFIGURATION";
   public static final String 
NOTE_THAT_THE_SYNTAX_FOR_SET_CONFIGURATION_IN_THE_TREE_MODEL_IS_NOT_EXACTLY_THE_SAME_AS
 =
 
       "注意:树模型中的 'set configuration' 语法与表模型中的语法并不完全相同。";
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 7b8102960d0..9f947b2c8c4 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
@@ -1792,6 +1792,11 @@ public class AstBuilder extends 
RelationalSqlBaseVisitor<Node> {
       properties = visit(ctx.propertyAssignments().property(), Property.class);
     }
     for (Property property : properties) {
+      if (property.isSetToDefault()) {
+        throw new SemanticException(
+            DataNodeQueryMessages
+                
.EXCEPTION_DEFAULT_IS_NOT_SUPPORTED_FOR_SET_CONFIGURATION_D76F13AD);
+      }
       String key = property.getName().getValue();
       Expression propertyValue = property.getNonDefaultValue();
       if 
(!propertyValue.getExpressionType().equals(TableExpressionType.STRING_LITERAL)) 
{

Reply via email to