You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2025/01/20 08:18:50 UTC

(iotdb) branch fx_table_name_in_compaction created (now ca7a61fc225)

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

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


      at ca7a61fc225 Fix incorrect DeviceId after concatenation

This branch includes the following new commits:

     new ca7a61fc225 Fix incorrect DeviceId after concatenation

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: Fix incorrect DeviceId after concatenation

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

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

commit ca7a61fc22514348f20df45d7238e66f4ab7f8b3
Author: Tian Jiang <jt...@163.com>
AuthorDate: Mon Jan 20 16:18:39 2025 +0800

    Fix incorrect DeviceId after concatenation
---
 .../src/main/java/org/apache/iotdb/commons/path/PartialPath.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 1b7163ca600..2fc31bfd830 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
@@ -241,7 +241,9 @@ public class PartialPath extends Path implements Comparable<Path>, Cloneable {
     int len = nodes.length;
     String[] newNodes = Arrays.copyOf(nodes, nodes.length + 1);
     newNodes[len] = measurement;
-    return new MeasurementPath(newNodes);
+    MeasurementPath measurementPath = new MeasurementPath(newNodes);
+    measurementPath.device = this.device;
+    return measurementPath;
   }
 
   /**
@@ -1066,6 +1068,10 @@ public class PartialPath extends Path implements Comparable<Path>, Cloneable {
   protected IDeviceID toDeviceID(String[] nodes) {
     String tableName;
     int segmentCnt = nodes.length;
+    // not a tree id, no need to generate dummy table
+    if (nodes.length > 0 && !Objects.equals(nodes[0], PATH_ROOT)) {
+      return Factory.DEFAULT_FACTORY.create(nodes);
+    }
     // assuming DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME = 3
     String[] segments;
     if (segmentCnt <= 1) {