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

zhihao pushed a commit to branch fix/szh/window_partition_bug
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2b3115fbe861334885eb9400507b5acb0d205a21
Author: Sh-Zh-7 <[email protected]>
AuthorDate: Wed Nov 26 09:44:17 2025 +0800

    Add UT for bug fixing.
---
 .../process/window/TableWindowOperatorTest.java    | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/process/window/TableWindowOperatorTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/process/window/TableWindowOperatorTest.java
index ed0ec405a9c..b444c4bfb62 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/process/window/TableWindowOperatorTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/process/window/TableWindowOperatorTest.java
@@ -192,6 +192,56 @@ public class TableWindowOperatorTest {
     }
   }
 
+  @Test
+  public void testMixedPartition2() {
+    long[][] timeArray =
+        new long[][] {
+            {1, 2, 3},
+            {4, 5},
+            {6},
+        };
+    String[][] deviceIdArray =
+        new String[][] {
+            {"d1", "d1", "d2"},
+            {"d2", "d3"},
+            {"d3"},
+        };
+    int[][] valueArray =
+        new int[][] {
+            {1, 2, 3},
+            {4, 5},
+            {6},
+        };
+
+    long[] expectColumn1 = new long[] {1, 2, 3, 4, 5, 6};
+    String[] expectColumn2 = new String[] {"d1", "d1", "d2", "d2", "d3", "d3"};
+    int[] expectColumn4 = new int[] {1, 2, 3, 4, 5, 6};
+    long[] expectColumn5 = new long[] {1, 2, 1, 2, 1, 2};
+
+    int count = 0;
+    try (TableWindowOperator windowOperator =
+             genWindowOperator(timeArray, deviceIdArray, valueArray)) {
+      ListenableFuture<?> listenableFuture = windowOperator.isBlocked();
+      listenableFuture.get();
+      while (!windowOperator.isFinished() && windowOperator.hasNext()) {
+        TsBlock tsBlock = windowOperator.next();
+        if (tsBlock != null && !tsBlock.isEmpty()) {
+          for (int i = 0, size = tsBlock.getPositionCount(); i < size; i++, 
count++) {
+            assertEquals(expectColumn1[count], 
tsBlock.getColumn(0).getLong(i));
+            assertEquals(
+                expectColumn2[count],
+                
tsBlock.getColumn(1).getBinary(i).getStringValue(TSFileConfig.STRING_CHARSET));
+            assertEquals(expectColumn4[count], tsBlock.getColumn(2).getInt(i));
+            assertEquals(expectColumn5[count], 
tsBlock.getColumn(3).getLong(i));
+          }
+        }
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+      fail(e.getMessage());
+    }
+  }
+
   static class ChildOperator implements Operator {
     private int index;
 

Reply via email to