From 77e88b15d023240dcf484249a978ca55923c090d Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 07:18:20 +0800 Subject: [PATCH 1/8] Add query test --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 54e3898..438395f 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -461,12 +461,19 @@ await session_pool.ExecuteNonQueryStatementAsync( while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); - Console.WriteLine("SELECT sql Passed"); + Console.WriteLine("SELECT * sql Passed"); res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); + Console.WriteLine("SELECT sql Passed"); + res = await session_pool.ExecuteQueryStatementAsync( + "select timestamp, status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); + res.ShowTableNames(); + while (res.HasNext()) Console.WriteLine(res.Next()); + await res.Close(); status = await session_pool.DeleteStorageGroupAsync(test_group_name); System.Diagnostics.Debug.Assert(status == 0); @@ -569,4 +576,4 @@ public async Task TestLastDataQuery() Console.WriteLine("LastDataQuery Passed"); } } -} \ No newline at end of file +} From 3ef92f03ef66ac620b47a0dac489dd58f5f11a06 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 07:22:27 +0800 Subject: [PATCH 2/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 438395f..302a840 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -461,7 +461,7 @@ await session_pool.ExecuteNonQueryStatementAsync( while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); - Console.WriteLine("SELECT * sql Passed"); + Console.WriteLine("SELECT sql Passed"); res = await session_pool.ExecuteQueryStatementAsync( "select * from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); @@ -470,7 +470,7 @@ await session_pool.ExecuteNonQueryStatementAsync( await res.Close(); Console.WriteLine("SELECT sql Passed"); res = await session_pool.ExecuteQueryStatementAsync( - "select timestamp, status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); + "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); while (res.HasNext()) Console.WriteLine(res.Next()); From df76c0bc86d9723816912d4d7d97424ba0bd5c91 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 07:28:24 +0800 Subject: [PATCH 3/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 302a840..0c4c552 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -472,6 +472,7 @@ await session_pool.ExecuteNonQueryStatementAsync( res = await session_pool.ExecuteQueryStatementAsync( "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); + Console.WriteLine(res.ShowTableNames()); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); From 3c2593bbeea9dac0daaf676dbbdb6b5933b42310 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 07:48:07 +0800 Subject: [PATCH 4/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 0c4c552..511a9af 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -472,14 +472,15 @@ await session_pool.ExecuteNonQueryStatementAsync( res = await session_pool.ExecuteQueryStatementAsync( "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); - Console.WriteLine(res.ShowTableNames()); + var columnNames = new List { "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.status", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.temperature", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.hardware" }; + System.Diagnostics.Debug.Assert(res.ColumnNames.SequenceEqual(list2), "The columnnNames are not equal"); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); + Console.WriteLine("SELECT sql Passed"); status = await session_pool.DeleteStorageGroupAsync(test_group_name); System.Diagnostics.Debug.Assert(status == 0); await session_pool.Close(); - Console.WriteLine("SELECT sql Passed"); } public async Task TestRawDataQuery() { From e6b71657a6e2da5e1e6997f1132d5dc5dffec7d7 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 07:49:27 +0800 Subject: [PATCH 5/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index 511a9af..e027e56 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -473,7 +473,7 @@ await session_pool.ExecuteNonQueryStatementAsync( "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); var columnNames = new List { "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.status", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.temperature", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.hardware" }; - System.Diagnostics.Debug.Assert(res.ColumnNames.SequenceEqual(list2), "The columnnNames are not equal"); + System.Diagnostics.Debug.Assert(res.ColumnNames.SequenceEqual(columnNames), "The columnnNames are not equal"); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); From 3f884a137c5604de721fd3f3273429934924c72b Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 07:52:55 +0800 Subject: [PATCH 6/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index e027e56..ed9d6d3 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -473,7 +473,7 @@ await session_pool.ExecuteNonQueryStatementAsync( "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); var columnNames = new List { "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.status", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.temperature", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.hardware" }; - System.Diagnostics.Debug.Assert(res.ColumnNames.SequenceEqual(columnNames), "The columnnNames are not equal"); + Console.WriteLine(res.ColumnNames); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); From 7e9858c0c4f1824c59601fedc66cc983bbf03419 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 08:00:14 +0800 Subject: [PATCH 7/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index ed9d6d3..bf385b4 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -19,6 +19,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Apache.IoTDB.Data; @@ -473,7 +474,7 @@ await session_pool.ExecuteNonQueryStatementAsync( "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); var columnNames = new List { "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.status", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.temperature", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.hardware" }; - Console.WriteLine(res.ColumnNames); + System.Diagnostics.Debug.Assert(columnNames.SequenceEqual(res.ColumnNames), "The columnnNames are not equal"); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close(); From e0be37f35684f143ae0da409e27c03e3d987cfaf Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 15 Nov 2024 09:46:13 +0800 Subject: [PATCH 8/8] Update SessionPoolTest.cs --- samples/Apache.IoTDB.Samples/SessionPoolTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs index bf385b4..cf8322e 100644 --- a/samples/Apache.IoTDB.Samples/SessionPoolTest.cs +++ b/samples/Apache.IoTDB.Samples/SessionPoolTest.cs @@ -474,7 +474,7 @@ await session_pool.ExecuteNonQueryStatementAsync( "select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10"); res.ShowTableNames(); var columnNames = new List { "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.status", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.temperature", "root.TEST_CSHARP_CLIENT_GROUP_97209.TEST_CSHARP_CLIENT_DEVICE.hardware" }; - System.Diagnostics.Debug.Assert(columnNames.SequenceEqual(res.ColumnNames), "The columnnNames are not equal"); + System.Diagnostics.Debug.Assert(columnNames.SequenceEqual(res.ColumnNames)); while (res.HasNext()) Console.WriteLine(res.Next()); await res.Close();