This is an automated email from the ASF dual-hosted git repository.
JackieTien97 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 d1aaa0dd909 Optimize errMsg when set configuration default- #18856
d1aaa0dd909 is described below
commit d1aaa0dd909cb767ef45667cfe749d6373388906
Author: Weihao Li <[email protected]>
AuthorDate: Mon Oct 19 09:04:29 2026 +0800
Optimize errMsg when set configuration default- #18856
---
.../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 ae3cef37406..c89034e8831 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
@@ -2561,6 +2561,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 d2723126d71..a3307bd07cb 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
@@ -2933,6 +2933,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 4e502e7d3bd..1d2417ea644 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
@@ -1806,6 +1806,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))
{