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

jiangtian pushed a commit to branch TableModelIngestion3
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/TableModelIngestion3 by this 
push:
     new 7cc5cd69eae Fix PartialPath deserialization
7cc5cd69eae is described below

commit 7cc5cd69eae8ac2b4c303023ae5713ca198bec6b
Author: Tian Jiang <[email protected]>
AuthorDate: Fri Jul 26 10:19:49 2024 +0800

    Fix PartialPath deserialization
---
 .../java/org/apache/iotdb/commons/path/AlignedPath.java  |  4 ++--
 .../org/apache/iotdb/commons/path/MeasurementPath.java   |  4 ++--
 .../java/org/apache/iotdb/commons/path/PartialPath.java  | 16 ++--------------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
index 2de9043dfa3..6bb91921769 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/AlignedPath.java
@@ -373,8 +373,8 @@ public class AlignedPath extends PartialPath {
     alignedPath.measurementList = measurements;
     alignedPath.schemaList = measurementSchemas;
     alignedPath.nodes = partialPath.getNodes();
-    alignedPath.device = partialPath.getIDeviceID();
-    alignedPath.fullPath = partialPath.getFullPath();
+    alignedPath.device = alignedPath.getIDeviceID();
+    alignedPath.fullPath = alignedPath.getFullPath();
     return alignedPath;
   }
 
diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
index 096266b7cba..7a39c955337 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/MeasurementPath.java
@@ -298,8 +298,8 @@ public class MeasurementPath extends PartialPath {
     measurementPath.isUnderAlignedEntity = 
ReadWriteIOUtils.readBoolObject(byteBuffer);
     measurementPath.measurementAlias = ReadWriteIOUtils.readString(byteBuffer);
     measurementPath.nodes = partialPath.getNodes();
-    measurementPath.device = partialPath.getIDeviceID();
-    measurementPath.fullPath = partialPath.getFullPath();
+    measurementPath.device = measurementPath.getIDeviceID();
+    measurementPath.fullPath = measurementPath.getFullPath();
     return measurementPath;
   }
 
diff --git 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
index 119895d4bf2..c4d3b9b47a4 100644
--- 
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
+++ 
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/path/PartialPath.java
@@ -822,22 +822,10 @@ public class PartialPath extends Path implements 
Comparable<Path>, Cloneable {
     return device;
   }
 
+  @Deprecated
   /** This PartialPath represents for full device path */
   public IDeviceID getIDeviceIDAsFullDevice() {
-    if (device != null) {
-      return device;
-    } else {
-      if (nodes.length == 1) {
-        return Factory.DEFAULT_FACTORY.create("");
-      }
-      StringBuilder s = new StringBuilder(nodes[0]);
-      for (int i = 1; i < nodes.length; i++) {
-        s.append(TsFileConstant.PATH_SEPARATOR);
-        s.append(nodes[i]);
-      }
-      device = Factory.DEFAULT_FACTORY.create(s.toString());
-    }
-    return device;
+    return getIDeviceID();
   }
 
   // todo remove measurement related interface after invoker using 
MeasurementPath explicitly

Reply via email to