From 02c4a96e2071754e32c5a8c1f15dddf997fa501a Mon Sep 17 00:00:00 2001 From: shizy Date: Tue, 14 Apr 2026 16:05:01 +0800 Subject: [PATCH 1/2] fix memory issue during testConcurrentCteQueries test --- .../apache/iotdb/relational/it/query/recent/IoTDBCteIT.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java index ceec77e78af6b..7f869cbf9e760 100644 --- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java @@ -498,7 +498,7 @@ public void testPrivileges() throws SQLException { @Test public void testConcurrentCteQueries() throws Exception { final int threadCount = 3; - final int queriesPerThread = 20; + final int queriesPerThread = 6; final AtomicInteger successCount = new AtomicInteger(0); final AtomicInteger failureCount = new AtomicInteger(0); final AtomicInteger totalCount = new AtomicInteger(0); @@ -527,7 +527,7 @@ public void testConcurrentCteQueries() throws Exception { // Test different types of CTE queries String[] queries = { String.format( - "WITH cte as %s (select * from testtb WHERE voltage > 150) select * from cte ORDER BY deviceid", + "WITH cte as %s (select * from testtb WHERE voltage > 150) select * from cte", cteKeywords[j % cteKeywords.length]), String.format( "WITH cte as %s (select deviceid, avg(voltage) as avg_v from testtb GROUP BY deviceid) select * from cte", @@ -609,7 +609,7 @@ public void testConcurrentCteQueries() throws Exception { int totalQueries = threadCount * queriesPerThread; assertEquals("All queries should succeed", totalQueries, successCount.get()); assertEquals("No queries should fail", 0, failureCount.get()); - assertEquals("Total query count should match", 102, totalCount.get()); + assertEquals("Total query count should match", 30, totalCount.get()); } private static void prepareData() { From 75d5cd397eb36faa7391aab36cc6ce7fcca502d3 Mon Sep 17 00:00:00 2001 From: shizy Date: Tue, 14 Apr 2026 16:26:21 +0800 Subject: [PATCH 2/2] order by deviceid in CTE --- .../org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java index 7f869cbf9e760..8c0b52acc944b 100644 --- a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBCteIT.java @@ -527,7 +527,7 @@ public void testConcurrentCteQueries() throws Exception { // Test different types of CTE queries String[] queries = { String.format( - "WITH cte as %s (select * from testtb WHERE voltage > 150) select * from cte", + "WITH cte as %s (select * from testtb WHERE voltage > 150 order by deviceid) select * from cte", cteKeywords[j % cteKeywords.length]), String.format( "WITH cte as %s (select deviceid, avg(voltage) as avg_v from testtb GROUP BY deviceid) select * from cte",