Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query test #22

Closed
wants to merge 8 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Apache.IoTDB.Data;
Expand Down Expand Up @@ -468,10 +469,19 @@ await session_pool.ExecuteNonQueryStatementAsync(
while (res.HasNext()) Console.WriteLine(res.Next());

await res.Close();
Console.WriteLine("SELECT sql Passed");
res = await session_pool.ExecuteQueryStatementAsync(
"select status, temperature, hardware from " + string.Format("{0}.{1}", test_group_name, test_device) + " where time<10");
res.ShowTableNames();
var columnNames = new List<string> { "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));
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()
{
Expand Down Expand Up @@ -569,4 +579,4 @@ public async Task TestLastDataQuery()
Console.WriteLine("LastDataQuery Passed");
}
}
}
}
Loading