You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2025/12/10 04:25:06 UTC

(iotdb) branch ty/object_type created (now 956e727e0e5)

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

jackietien pushed a change to branch ty/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 956e727e0e5 Forbid some interface and add new interface in Record

This branch includes the following new commits:

     new 956e727e0e5 Forbid some interface and add new interface in Record

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(iotdb) 01/01: Forbid some interface and add new interface in Record

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch ty/object_type
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 956e727e0e5e4b3454152d30661b96e14ca67fd2
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Tue Dec 9 18:08:38 2025 +0800

    Forbid some interface and add new interface in Record
---
 .../it/query/object/IoTDBObjectQueryIT.java        | 46 ++++++++++++++--------
 .../iotdb/udf/api/relational/access/Record.java    | 13 +++++-
 .../org/apache/iotdb/isession/SessionDataSet.java  | 16 ++++++++
 .../org/apache/iotdb/jdbc/IoTDBJDBCResultSet.java  | 29 ++++++++++++--
 .../operator/process/function/partition/Slice.java | 24 ++++++++++-
 .../relational/aggregation/RecordIterator.java     | 26 +++++++++++-
 .../planner/distribute/AddExchangeNodes.java       | 41 ++++++++++++++++++-
 .../org/apache/iotdb/db/utils/ObjectTypeUtils.java |  8 +---
 .../plan/function/RecordObjectTypeTest.java        | 35 ++++++++++------
 .../apache/iotdb/commons/conf/CommonConfig.java    |  2 +-
 pom.xml                                            |  2 +-
 11 files changed, 198 insertions(+), 44 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/object/IoTDBObjectQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/object/IoTDBObjectQueryIT.java
index 4fad2d2696b..65c0f09e413 100644
--- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/object/IoTDBObjectQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/object/IoTDBObjectQueryIT.java
@@ -33,21 +33,19 @@ import org.apache.iotdb.rpc.StatementExecutionException;
 import org.apache.tsfile.enums.TSDataType;
 import org.apache.tsfile.read.common.Field;
 import org.apache.tsfile.read.common.RowRecord;
-import org.apache.tsfile.utils.Binary;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 
-import java.sql.Blob;
 import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 
 import static org.apache.iotdb.db.it.utils.TestUtils.prepareTableData;
-import static org.junit.Assert.assertArrayEquals;
+import static org.apache.iotdb.jdbc.IoTDBJDBCResultSet.OBJECT_ERR_MSG;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -104,10 +102,20 @@ public class IoTDBObjectQueryIT {
           int cnt = 0;
           while (resultSet.next()) {
             cnt++;
-            Blob blob = resultSet.getBlob(3);
-            byte[] bytes = resultSet.getBytes("o1");
-            assertArrayEquals(blob.getBytes(1, (int) blob.length()), bytes);
-            assertTrue(new String(bytes).endsWith(String.format("%d.bin", cnt)));
+            try {
+              resultSet.getBlob(3);
+              fail();
+            } catch (SQLException e) {
+              assertEquals(OBJECT_ERR_MSG, e.getMessage());
+            }
+
+            try {
+              resultSet.getBytes("o1");
+              fail();
+            } catch (SQLException e) {
+              assertEquals(OBJECT_ERR_MSG, e.getMessage());
+            }
+
             String s = resultSet.getString(3);
             assertEquals("(Object) 5 B", s);
           }
@@ -150,13 +158,15 @@ public class IoTDBObjectQueryIT {
           String s = field.getStringValue();
           assertEquals("(Object) 5 B", s);
           Object blob = field.getObjectValue(TSDataType.OBJECT);
-          assertTrue(blob instanceof Binary);
-          assertTrue(
-              new String(((Binary) blob).getValues()).endsWith(String.format("%d.bin", cnt)));
-
-          Binary binary = field.getBinaryV();
-          assertArrayEquals(binary.getValues(), ((Binary) blob).getValues());
-          assertTrue(new String(binary.getValues()).endsWith(String.format("%d.bin", cnt)));
+          assertTrue(blob instanceof String);
+          assertEquals("(Object) 5 B", blob);
+
+          try {
+            field.getBinaryV();
+            fail();
+          } catch (UnsupportedOperationException e) {
+            assertEquals("OBJECT Type only support getStringValue", e.getMessage());
+          }
         }
         assertEquals(4, cnt);
       }
@@ -174,8 +184,12 @@ public class IoTDBObjectQueryIT {
           assertEquals("(Object) 5 B", o);
           String s = iterator.getString("o1");
           assertEquals("(Object) 5 B", s);
-          Binary blob = iterator.getBlob(3);
-          assertTrue(new String(blob.getValues()).endsWith(String.format("%d.bin", cnt)));
+          try {
+            iterator.getBlob(3);
+            fail();
+          } catch (StatementExecutionException e) {
+            assertEquals("OBJECT Type only support getString", e.getMessage());
+          }
         }
         assertEquals(4, cnt);
       }
diff --git a/iotdb-api/udf-api/src/main/java/org/apache/iotdb/udf/api/relational/access/Record.java b/iotdb-api/udf-api/src/main/java/org/apache/iotdb/udf/api/relational/access/Record.java
index 4267f41dc8d..538b8c296c1 100644
--- a/iotdb-api/udf-api/src/main/java/org/apache/iotdb/udf/api/relational/access/Record.java
+++ b/iotdb-api/udf-api/src/main/java/org/apache/iotdb/udf/api/relational/access/Record.java
@@ -23,7 +23,9 @@ import org.apache.iotdb.udf.api.type.Type;
 
 import org.apache.tsfile.utils.Binary;
 
+import java.io.File;
 import java.time.LocalDate;
+import java.util.Optional;
 
 public interface Record {
   /**
@@ -83,7 +85,7 @@ public interface Record {
    * Returns the Binary value at the specified column in this row.
    *
    * <p>Users need to ensure that the data type of the specified column is {@code TSDataType.TEXT},
-   * {@code TSDataType.STRING} or {@code TSDataType.BLOB} or {@code TSDataType.OBJECT}.
+   * {@code TSDataType.STRING} or {@code TSDataType.BLOB}.
    *
    * @param columnIndex index of the specified column
    * @return the Binary value at the specified column in this row
@@ -113,6 +115,15 @@ public interface Record {
 
   Object getObject(int columnIndex);
 
+  /**
+   * Returns the OBJECT value's real file path in current node at the specified column in this row.
+   *
+   * @param columnIndex index of the specified column
+   * @return Optional.empty() if current node doesn't have the real file storing the object content,
+   *     otherwise the File referring to the OBJECT value's real file path
+   */
+  Optional<File> getObjectFile(int columnIndex);
+
   /**
    * Returns the Binary representation of an object stored at the specified column in this row.
    *
diff --git a/iotdb-client/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java b/iotdb-client/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java
index bb113680d8e..9a1fcd29148 100644
--- a/iotdb-client/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java
+++ b/iotdb-client/isession/src/main/java/org/apache/iotdb/isession/SessionDataSet.java
@@ -327,10 +327,26 @@ public class SessionDataSet implements ISessionDataSet {
     }
 
     public Binary getBlob(int columnIndex) throws StatementExecutionException {
+      final TSDataType dataType = ioTDBRpcDataSet.getDataType(columnIndex);
+      if (dataType == null) {
+        return null;
+      }
+
+      if (dataType.equals(TSDataType.OBJECT)) {
+        throw new StatementExecutionException("OBJECT Type only support getString");
+      }
       return ioTDBRpcDataSet.getBinary(columnIndex);
     }
 
     public Binary getBlob(String columnName) throws StatementExecutionException {
+      final TSDataType dataType = ioTDBRpcDataSet.getDataType(columnName);
+      if (dataType == null) {
+        return null;
+      }
+
+      if (dataType.equals(TSDataType.OBJECT)) {
+        throw new StatementExecutionException("OBJECT Type only support getString");
+      }
       return ioTDBRpcDataSet.getBinary(columnName);
     }
 
diff --git a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBJDBCResultSet.java b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBJDBCResultSet.java
index ff00e3b35df..f9c3fe481ac 100644
--- a/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBJDBCResultSet.java
+++ b/iotdb-client/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBJDBCResultSet.java
@@ -70,6 +70,8 @@ import static org.apache.iotdb.rpc.RpcUtils.convertToTimestamp;
 
 public class IoTDBJDBCResultSet implements ResultSet {
 
+  public static final String OBJECT_ERR_MSG = "OBJECT Type only support getString";
+
   private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBJDBCResultSet.class);
 
   protected IoTDBStatement statement;
@@ -301,6 +303,15 @@ public class IoTDBJDBCResultSet implements ResultSet {
   @Override
   public Blob getBlob(int arg0) throws SQLException {
     try {
+      final TSDataType dataType = ioTDBRpcDataSet.getDataType(arg0);
+      if (dataType == null) {
+        return null;
+      }
+
+      if (dataType.equals(TSDataType.OBJECT)) {
+        throw new SQLException(OBJECT_ERR_MSG);
+      }
+
       Binary binary = ioTDBRpcDataSet.getBinary(arg0);
       if (ObjectUtils.isNotEmpty(binary)) {
         return new SerialBlob(binary.getValues());
@@ -314,6 +325,15 @@ public class IoTDBJDBCResultSet implements ResultSet {
   @Override
   public Blob getBlob(String arg0) throws SQLException {
     try {
+      final TSDataType dataType = ioTDBRpcDataSet.getDataType(arg0);
+      if (dataType == null) {
+        return null;
+      }
+
+      if (dataType.equals(TSDataType.OBJECT)) {
+        throw new SQLException(OBJECT_ERR_MSG);
+      }
+
       Binary binary = ioTDBRpcDataSet.getBinary(arg0);
       if (ObjectUtils.isNotEmpty(binary)) {
         return new SerialBlob(binary.getValues());
@@ -360,7 +380,9 @@ public class IoTDBJDBCResultSet implements ResultSet {
         return null;
       }
 
-      if (dataType.equals(TSDataType.BLOB) || dataType.equals(TSDataType.OBJECT)) {
+      if (dataType.equals(TSDataType.OBJECT)) {
+        throw new SQLException(OBJECT_ERR_MSG);
+      } else if (dataType.equals(TSDataType.BLOB)) {
         Binary binary = ioTDBRpcDataSet.getBinary(columnIndex);
         return binary == null ? null : binary.getValues();
       } else {
@@ -379,8 +401,9 @@ public class IoTDBJDBCResultSet implements ResultSet {
       if (dataType == null) {
         return null;
       }
-
-      if (dataType.equals(TSDataType.BLOB) || dataType.equals(TSDataType.OBJECT)) {
+      if (dataType.equals(TSDataType.OBJECT)) {
+        throw new SQLException(OBJECT_ERR_MSG);
+      } else if (dataType.equals(TSDataType.BLOB)) {
         Binary binary = ioTDBRpcDataSet.getBinary(columnName);
         return binary == null ? null : binary.getValues();
       } else {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/partition/Slice.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/partition/Slice.java
index 599efc4f240..a34a0eb650d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/partition/Slice.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/function/partition/Slice.java
@@ -29,14 +29,17 @@ import org.apache.tsfile.utils.Binary;
 import org.apache.tsfile.utils.BytesUtils;
 import org.apache.tsfile.utils.DateUtils;
 
+import java.io.File;
 import java.time.LocalDate;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.apache.iotdb.db.queryengine.execution.operator.source.relational.aggregation.RecordIterator.OBJECT_ERR_MSG;
 import static org.apache.iotdb.udf.api.type.Type.OBJECT;
 
 /** Parts of partition. */
@@ -170,6 +173,14 @@ public class Slice {
 
     @Override
     public Binary getBinary(int columnIndex) {
+      Type type = dataTypes.get(columnIndex);
+      if (type == OBJECT) {
+        throw new UnsupportedOperationException(OBJECT_ERR_MSG);
+      }
+      return getBinarySafely(columnIndex);
+    }
+
+    public Binary getBinarySafely(int columnIndex) {
       return originalColumns[columnIndex].getBinary(offset);
     }
 
@@ -193,15 +204,24 @@ public class Slice {
 
     @Override
     public Object getObject(int columnIndex) {
+      Type type = dataTypes.get(columnIndex);
+      if (type == OBJECT) {
+        throw new UnsupportedOperationException(OBJECT_ERR_MSG);
+      }
       return originalColumns[columnIndex].getObject(offset);
     }
 
     @Override
-    public Binary readObject(int columnIndex, long offset, int length) {
+    public Optional<File> getObjectFile(int columnIndex) {
       if (getDataType(columnIndex) != Type.OBJECT) {
         throw new UnsupportedOperationException("current column is not object column");
       }
-      Binary binary = getBinary(columnIndex);
+      return ObjectTypeUtils.getObjectPathFromBinary(getBinarySafely(columnIndex));
+    }
+
+    @Override
+    public Binary readObject(int columnIndex, long offset, int length) {
+      Binary binary = getBinarySafely(columnIndex);
       return new Binary(ObjectTypeUtils.readObjectContent(binary, offset, length, true).array());
     }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/RecordIterator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/RecordIterator.java
index 9151ef31e0d..ae66a11729d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/RecordIterator.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/aggregation/RecordIterator.java
@@ -31,14 +31,19 @@ import org.apache.tsfile.utils.Binary;
 import org.apache.tsfile.utils.BytesUtils;
 import org.apache.tsfile.utils.DateUtils;
 
+import java.io.File;
 import java.time.LocalDate;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Optional;
 
 import static org.apache.tsfile.read.common.type.BlobType.BLOB;
 
 public class RecordIterator implements Iterator<Record> {
 
+  public static final String OBJECT_ERR_MSG =
+      "OBJECT Type only support getString, getObjectFile, objectLength and readObject";
+
   private final List<Column> childrenColumns;
   private final List<org.apache.tsfile.read.common.type.Type> dataTypes;
   private final int positionCount;
@@ -113,6 +118,14 @@ public class RecordIterator implements Iterator<Record> {
 
     @Override
     public Binary getBinary(int columnIndex) {
+      org.apache.tsfile.read.common.type.Type type = dataTypes.get(columnIndex);
+      if (type == ObjectType.OBJECT) {
+        throw new UnsupportedOperationException(OBJECT_ERR_MSG);
+      }
+      return getBinarySafely(columnIndex);
+    }
+
+    private Binary getBinarySafely(int columnIndex) {
       return childrenColumns.get(columnIndex).getBinary(index);
     }
 
@@ -136,15 +149,24 @@ public class RecordIterator implements Iterator<Record> {
 
     @Override
     public Object getObject(int columnIndex) {
+      org.apache.tsfile.read.common.type.Type type = dataTypes.get(columnIndex);
+      if (type == ObjectType.OBJECT) {
+        throw new UnsupportedOperationException(OBJECT_ERR_MSG);
+      }
       return childrenColumns.get(columnIndex).getObject(index);
     }
 
     @Override
-    public Binary readObject(int columnIndex, long offset, int length) {
+    public Optional<File> getObjectFile(int columnIndex) {
       if (getDataType(columnIndex) != Type.OBJECT) {
         throw new UnsupportedOperationException("current column is not object column");
       }
-      Binary binary = getBinary(columnIndex);
+      return ObjectTypeUtils.getObjectPathFromBinary(getBinarySafely(columnIndex));
+    }
+
+    @Override
+    public Binary readObject(int columnIndex, long offset, int length) {
+      Binary binary = getBinarySafely(columnIndex);
       return new Binary(ObjectTypeUtils.readObjectContent(binary, offset, length, true).array());
     }
 
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/AddExchangeNodes.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/AddExchangeNodes.java
index 225137b328e..9cef4807028 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/AddExchangeNodes.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/AddExchangeNodes.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanNode;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.PlanVisitor;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.WritePlanNode;
 import org.apache.iotdb.db.queryengine.plan.planner.plan.node.metadata.read.TableDeviceSourceNode;
+import org.apache.iotdb.db.queryengine.plan.relational.planner.node.CollectNode;
 import org.apache.iotdb.db.queryengine.plan.relational.planner.node.ExchangeNode;
 import org.apache.iotdb.db.queryengine.plan.relational.planner.node.ExplainAnalyzeNode;
 import org.apache.iotdb.db.queryengine.plan.relational.planner.node.TableFunctionProcessorNode;
@@ -68,7 +69,7 @@ public class AddExchangeNodes
               SAME_WITH_ALL_CHILDREN,
               context
                   .nodeDistributionMap
-                  .get(node.getChildren().get(0).getPlanNodeId())
+                  .get(newNode.getChildren().get(0).getPlanNodeId())
                   .getRegion()));
       return newNode;
     }
@@ -129,6 +130,9 @@ public class AddExchangeNodes
 
     ExchangeNode exchangeNode = new ExchangeNode(queryContext.getQueryId().genPlanNodeId());
     exchangeNode.setChild(child);
+    context.nodeDistributionMap.put(
+        exchangeNode.getPlanNodeId(),
+        new NodeDistribution(DIFFERENT_FROM_ALL_CHILDREN, DataPartition.NOT_ASSIGNED));
     exchangeNode.setOutputSymbols(child.getOutputSymbols());
     newNode.setChild(exchangeNode);
 
@@ -139,6 +143,41 @@ public class AddExchangeNodes
     return newNode;
   }
 
+  @Override
+  public PlanNode visitCollect(
+      CollectNode node, TableDistributedPlanGenerator.PlanContext context) {
+    PlanNode newNode = node.clone();
+    if (node.getChildren().size() == 1) {
+      newNode.addChild(node.getChildren().get(0).accept(this, context));
+      context.nodeDistributionMap.put(
+          node.getPlanNodeId(),
+          new NodeDistribution(
+              SAME_WITH_ALL_CHILDREN,
+              context
+                  .nodeDistributionMap
+                  .get(newNode.getChildren().get(0).getPlanNodeId())
+                  .getRegion()));
+      return newNode;
+    }
+
+    for (PlanNode child : node.getChildren()) {
+      PlanNode rewriteNode = child.accept(this, context);
+      ExchangeNode exchangeNode = new ExchangeNode(queryContext.getQueryId().genPlanNodeId());
+      exchangeNode.addChild(rewriteNode);
+      exchangeNode.setOutputSymbols(rewriteNode.getOutputSymbols());
+      newNode.addChild(exchangeNode);
+      context.hasExchangeNode = true;
+      context.nodeDistributionMap.put(
+          exchangeNode.getPlanNodeId(),
+          new NodeDistribution(DIFFERENT_FROM_ALL_CHILDREN, DataPartition.NOT_ASSIGNED));
+    }
+    context.nodeDistributionMap.put(
+        newNode.getPlanNodeId(),
+        new NodeDistribution(DIFFERENT_FROM_ALL_CHILDREN, DataPartition.NOT_ASSIGNED));
+
+    return newNode;
+  }
+
   @Override
   public PlanNode visitTableFunctionProcessor(
       TableFunctionProcessorNode node, TableDistributedPlanGenerator.PlanContext context) {
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
index 44ba3235911..7dd142b77ce 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ObjectTypeUtils.java
@@ -179,15 +179,11 @@ public class ObjectTypeUtils {
     return wrap.getLong();
   }
 
-  public static File getObjectPathFromBinary(Binary binary) {
+  public static Optional<File> getObjectPathFromBinary(Binary binary) {
     byte[] bytes = binary.getValues();
     String relativeObjectFilePath =
         new String(bytes, 8, bytes.length - 8, TSFileConfig.STRING_CHARSET);
-    Optional<File> file = TIER_MANAGER.getAbsoluteObjectFilePath(relativeObjectFilePath);
-    if (!file.isPresent()) {
-      throw new ObjectFileNotExist(relativeObjectFilePath);
-    }
-    return file.get();
+    return TIER_MANAGER.getAbsoluteObjectFilePath(relativeObjectFilePath);
   }
 
   public static Optional<File> getNullableObjectPathFromBinary(
diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/function/RecordObjectTypeTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/function/RecordObjectTypeTest.java
index e0a6ca88825..c5e745aea87 100644
--- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/function/RecordObjectTypeTest.java
+++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/function/RecordObjectTypeTest.java
@@ -23,7 +23,6 @@ import org.apache.iotdb.db.exception.DiskSpaceInsufficientException;
 import org.apache.iotdb.db.queryengine.execution.operator.process.function.partition.Slice;
 import org.apache.iotdb.db.queryengine.execution.operator.source.relational.aggregation.RecordIterator;
 import org.apache.iotdb.db.storageengine.rescon.disk.TierManager;
-import org.apache.iotdb.db.utils.ObjectTypeUtils;
 import org.apache.iotdb.udf.api.relational.access.Record;
 import org.apache.iotdb.udf.api.type.Type;
 
@@ -34,7 +33,6 @@ import org.apache.tsfile.read.common.block.column.BinaryColumnBuilder;
 import org.apache.tsfile.read.common.type.ObjectType;
 import org.apache.tsfile.utils.Binary;
 import org.apache.tsfile.utils.BytesUtils;
-import org.apache.tsfile.utils.Pair;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -47,6 +45,12 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.Optional;
+
+import static org.apache.iotdb.db.queryengine.execution.operator.source.relational.aggregation.RecordIterator.OBJECT_ERR_MSG;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 public class RecordObjectTypeTest {
 
@@ -98,23 +102,32 @@ public class RecordObjectTypeTest {
     Record record = recordIterator.next();
 
     Binary result = record.readObject(0);
-    Assert.assertEquals(100, result.getLength());
+    assertEquals(100, result.getLength());
     for (int j = 0; j < 100; j++) {
-      Assert.assertEquals(j, result.getValues()[j]);
+      assertEquals(j, result.getValues()[j]);
     }
 
     result = record.readObject(0, 10, 2);
     Assert.assertArrayEquals(new byte[] {(byte) 10, (byte) 11}, result.getValues());
 
-    Object object = record.getObject(0);
-    Assert.assertTrue(object instanceof Binary);
-    Pair<Long, String> pair = ObjectTypeUtils.parseObjectBinary((Binary) object);
-    Assert.assertEquals(Long.valueOf(100L), pair.getLeft());
-    Assert.assertTrue(pair.getRight().startsWith("test_") && pair.getRight().endsWith(".bin"));
+    try {
+      record.getObject(0);
+      fail("Should throw exception");
+    } catch (UnsupportedOperationException e) {
+      assertEquals(OBJECT_ERR_MSG, e.getMessage());
+    }
+
+    try {
+      record.getBinary(0);
+      fail("Should throw exception");
+    } catch (UnsupportedOperationException e) {
+      assertEquals(OBJECT_ERR_MSG, e.getMessage());
+    }
 
-    Assert.assertArrayEquals(((Binary) object).getValues(), record.getBinary(0).getValues());
+    Optional<File> objectFile = record.getObjectFile(0);
+    assertTrue(objectFile.isPresent());
 
-    Assert.assertEquals("(Object) 100 B", record.getString(0));
+    assertEquals("(Object) 100 B", record.getString(0));
     Assert.assertFalse(recordIterator.hasNext());
   }
 
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 62bc89ec5ae..8a27bb38179 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -187,7 +187,7 @@ public class CommonConfig {
   private long timePartitionInterval = 604_800_000;
 
   /** This variable set timestamp precision as millisecond, microsecond or nanosecond. */
-  private String timestampPrecision = "ms";
+  private String timestampPrecision = "ns";
 
   private boolean timestampPrecisionCheckEnabled = true;
 
diff --git a/pom.xml b/pom.xml
index 6841b716978..d9df3de1bf7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -173,7 +173,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.2.0-251208-SNAPSHOT</tsfile.version>
+        <tsfile.version>2.2.0-251209-SNAPSHOT</tsfile.version>
     </properties>
     <!--
     if we claim dependencies in dependencyManagement, then we do not claim