shuwenwei commented on code in PR #14617:
URL: https://github.com/apache/iotdb/pull/14617#discussion_r2050376795


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/read/resp/info/impl/ShowDevicesResult.java:
##########
@@ -81,13 +83,25 @@ public PartialPath getPartialPath() {
   }
 
   public static ShowDevicesResult convertDeviceEntry2ShowDeviceResult(
-      final DeviceEntry entry, final List<String> attributeColumns) {
+      final DeviceEntry entry, final List<String> attributeColumns, final int 
databaseSegmentNum) {
+    final String deviceIdStr = entry.getDeviceID().toString();
     final ShowDevicesResult result =
         new ShowDevicesResult(
-            entry.getDeviceID().toString(), null, -1, (String[]) 
entry.getDeviceID().getSegments());
+            deviceIdStr,
+            null,
+            -1,
+            databaseSegmentNum > 0
+                ? Arrays.copyOfRange(
+                    
TreeViewSchema.forceSeparateStringToPartialPath(deviceIdStr).getNodes(),
+                    databaseSegmentNum - 1,
+                    
TreeViewSchema.forceSeparateStringToPartialPath(deviceIdStr).getNodeLength())
+                : (String[]) entry.getDeviceID().getSegments());
     final Map<String, Binary> attributeProviderMap = new HashMap<>();
-    for (int i = 0; i < attributeColumns.size(); ++i) {
-      attributeProviderMap.put(attributeColumns.get(i), 
entry.getAttributeColumnValues()[i]);
+
+    if (entry instanceof AlignedDeviceEntry) {

Review Comment:
   What is the meaning of this judgment?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to