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

jackietien 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 9c9eae14f90 Banned the duplicated properties in table
9c9eae14f90 is described below

commit 9c9eae14f9041cc5eb7c8304538f806ad9cf71c0
Author: Caideyipi <[email protected]>
AuthorDate: Tue Apr 7 14:15:07 2026 +0800

    Banned the duplicated properties in table
---
 .../java/org/apache/iotdb/relational/it/schema/IoTDBTableIT.java  | 8 ++++++++
 .../queryengine/plan/execution/config/TableConfigTaskVisitor.java | 4 ++++
 2 files changed, 12 insertions(+)

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 b335278321c..66635919755 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
@@ -108,6 +108,14 @@ public class IoTDBTableIT {
         assertFalse(resultSet.next());
       }
 
+      try {
+        statement.execute(
+            "create table test1.table1(region_id STRING TAG, plant_id STRING 
TAG, device_id STRING TAG, model STRING ATTRIBUTE, temperature FLOAT FIELD, 
humidity DOUBLE FIELD) with (ttl=100, ttl=200, ttl=300)");
+        fail();
+      } catch (final SQLException e) {
+        assertEquals("701: Duplicated property: ttl", e.getMessage());
+      }
+
       // or use full qualified table name
       // test "TTL=INF"
       // "FIELD" can be omitted when type is specified
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
index c2f903398e2..9a622a751c3 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/TableConfigTaskVisitor.java
@@ -880,8 +880,12 @@ public class TableConfigTaskVisitor extends 
AstVisitor<IConfigTask, MPPQueryCont
   private Map<String, String> convertPropertiesToMap(
       final List<Property> propertyList, final boolean serializeDefault) {
     final Map<String, String> map = new HashMap<>();
+    final Set<String> deduplicate = new HashSet<>();
     for (final Property property : propertyList) {
       final String key = 
property.getName().getValue().toLowerCase(Locale.ENGLISH);
+      if (!deduplicate.add(key)) {
+        throw new SemanticException("Duplicated property: " + key);
+      }
       if (TABLE_ALLOWED_PROPERTIES.contains(key)) {
         if (!property.isSetToDefault()) {
           final Expression value = property.getNonDefaultValue();

Reply via email to