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 f56e06b32c7 Make null comment display "null" instead of "" in details 
queries & Updated tsFile version
f56e06b32c7 is described below

commit f56e06b32c7b6ee9fa8f2588dc41d5744bc07269
Author: Caideyipi <[email protected]>
AuthorDate: Mon Mar 24 19:35:46 2025 +0800

    Make null comment display "null" instead of "" in details queries & Updated 
tsFile version
---
 .../apache/iotdb/relational/it/schema/IoTDBTableIT.java  |  3 ++-
 .../metadata/relational/DescribeTableDetailsTask.java    | 16 ++++++++++------
 .../metadata/relational/ShowTablesDetailsTask.java       | 13 +++++++------
 .../db/schemaengine/table/InformationSchemaUtils.java    |  4 ++--
 pom.xml                                                  |  2 +-
 5 files changed, 22 insertions(+), 16 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 ed01feff121..52de0886ac6 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
@@ -418,12 +418,13 @@ public class IoTDBTableIT {
       statement.execute("COMMENT ON COLUMN table2.region_id IS '重庆'");
       statement.execute("COMMENT ON COLUMN table2.region_id IS NULL");
       statement.execute("COMMENT ON COLUMN test2.table2.time IS 'recent'");
+      statement.execute("COMMENT ON COLUMN test2.table2.region_id IS ''");
 
       columnNames = new String[] {"time", "region_id", "plant_id", 
"temperature", "speed"};
       dataTypes = new String[] {"TIMESTAMP", "STRING", "STRING", "FLOAT", 
"DOUBLE"};
       categories = new String[] {"TIME", "TAG", "TAG", "FIELD", "FIELD"};
       statuses = new String[] {"USING", "USING", "USING", "USING", "USING"};
-      comments = new String[] {"recent", "", "", "", "fast"};
+      comments = new String[] {"recent", "", null, null, "fast"};
       try (final ResultSet resultSet = statement.executeQuery("describe table2 
details")) {
         int cnt = 0;
         ResultSetMetaData metaData = resultSet.getMetaData();
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/DescribeTableDetailsTask.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/DescribeTableDetailsTask.java
index eb84c21a912..54fee70d070 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/DescribeTableDetailsTask.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/DescribeTableDetailsTask.java
@@ -79,12 +79,16 @@ public class DescribeTableDetailsTask extends 
AbstractTableTask {
               new Binary(
                   preDeletedColumns.contains(columnSchema.getColumnName()) ? 
"PRE_DELETE" : "USING",
                   TSFileConfig.STRING_CHARSET));
-      builder
-          .getColumnBuilder(4)
-          .writeBinary(
-              new Binary(
-                  columnSchema.getProps().getOrDefault(TsTable.COMMENT_KEY, 
""),
-                  TSFileConfig.STRING_CHARSET));
+
+      if (columnSchema.getProps().containsKey(TsTable.COMMENT_KEY)) {
+        builder
+            .getColumnBuilder(4)
+            .writeBinary(
+                new Binary(
+                    columnSchema.getProps().get(TsTable.COMMENT_KEY), 
TSFileConfig.STRING_CHARSET));
+      } else {
+        builder.getColumnBuilder(4).appendNull();
+      }
       builder.declarePosition();
     }
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowTablesDetailsTask.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowTablesDetailsTask.java
index 158b445e32e..b1e989622ff 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowTablesDetailsTask.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/relational/ShowTablesDetailsTask.java
@@ -86,12 +86,13 @@ public class ShowTablesDetailsTask implements IConfigTask {
                       new Binary(
                           
TableNodeStatus.values()[tableInfo.getState()].toString(),
                           TSFileConfig.STRING_CHARSET));
-              builder
-                  .getColumnBuilder(3)
-                  .writeBinary(
-                      new Binary(
-                          tableInfo.isSetComment() ? tableInfo.getComment() : 
"",
-                          TSFileConfig.STRING_CHARSET));
+              if (tableInfo.isSetComment()) {
+                builder
+                    .getColumnBuilder(3)
+                    .writeBinary(new Binary(tableInfo.getComment(), 
TSFileConfig.STRING_CHARSET));
+              } else {
+                builder.getColumnBuilder(3).appendNull();
+              }
 
               builder.declarePosition();
             });
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/InformationSchemaUtils.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/InformationSchemaUtils.java
index d54698b2735..4fe1c1c715c 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/InformationSchemaUtils.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/table/InformationSchemaUtils.java
@@ -120,7 +120,7 @@ public class InformationSchemaUtils {
       builder.getColumnBuilder(1).writeBinary(new Binary("INF", 
TSFileConfig.STRING_CHARSET));
       if (isDetails) {
         builder.getColumnBuilder(2).writeBinary(new Binary("USING", 
TSFileConfig.STRING_CHARSET));
-        builder.getColumnBuilder(3).writeBinary(new Binary("", 
TSFileConfig.STRING_CHARSET));
+        builder.getColumnBuilder(3).appendNull();
       }
       builder.declarePosition();
     }
@@ -172,7 +172,7 @@ public class InformationSchemaUtils {
               new Binary(columnSchema.getColumnCategory().name(), 
TSFileConfig.STRING_CHARSET));
       if (isDetails) {
         builder.getColumnBuilder(3).writeBinary(new Binary("USING", 
TSFileConfig.STRING_CHARSET));
-        builder.getColumnBuilder(4).writeBinary(new Binary("", 
TSFileConfig.STRING_CHARSET));
+        builder.getColumnBuilder(4).appendNull();
       }
       builder.declarePosition();
     }
diff --git a/pom.xml b/pom.xml
index ed8b5dd9942..56da450f9df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -175,7 +175,7 @@
         <thrift.version>0.14.1</thrift.version>
         <xz.version>1.9</xz.version>
         <zstd-jni.version>1.5.6-3</zstd-jni.version>
-        <tsfile.version>2.1.0-250219-SNAPSHOT</tsfile.version>
+        <tsfile.version>2.1.0-250324-SNAPSHOT</tsfile.version>
     </properties>
     <!--
     if we claim dependencies in dependencyManagement, then we do not claim

Reply via email to