Skip to content

Commit c254800

Browse files
committed
fix compilation error
1 parent d3c43d7 commit c254800

File tree

2 files changed

+62
-8
lines changed

2 files changed

+62
-8
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using Apache.IoTDB.DataStructure;
4+
5+
namespace Apache.IoTDB.Samples
6+
{
7+
public partial class SessionPoolTest
8+
{
9+
public static void PrintDataSetByObject(SessionDataSet sessionDataSet)
10+
{
11+
IReadOnlyList<string> columns = sessionDataSet.GetColumnNames();
12+
13+
foreach (string columnName in columns)
14+
{
15+
Console.Write($"{columnName}\t");
16+
}
17+
Console.WriteLine();
18+
19+
while (sessionDataSet.HasNext())
20+
{
21+
for (int i = 0; i < columns.Count; i++)
22+
{
23+
string columnName = columns[i];
24+
Console.Write(sessionDataSet.GetObject(columnName));
25+
Console.Write("\t\t");
26+
}
27+
Console.WriteLine();
28+
}
29+
}
30+
31+
public static void PrintDataSetByString(SessionDataSet sessionDataSet)
32+
{
33+
IReadOnlyList<string> columns = sessionDataSet.GetColumnNames();
34+
35+
foreach (string columnName in columns)
36+
{
37+
Console.Write($"{columnName}\t");
38+
}
39+
Console.WriteLine();
40+
41+
while (sessionDataSet.HasNext())
42+
{
43+
for (int i = 0; i < columns.Count; i++)
44+
{
45+
string columnName = columns[i];
46+
Console.Write(sessionDataSet.GetString(columnName));
47+
Console.Write("\t\t");
48+
}
49+
Console.WriteLine();
50+
}
51+
}
52+
53+
}
54+
}

samples/Apache.IoTDB.Samples/SessionPoolTest.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public async Task TestDeleteData()
324324
System.Diagnostics.Debug.Assert(status == 0);
325325
var res = await session_pool.ExecuteQueryStatementAsync(
326326
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
327-
UtilsTest.PrintDataSetByString(res);
327+
SessionPoolTest.PrintDataSetByString(res);
328328

329329
await res.Close();
330330
var ts_path_lst = new List<string>()
@@ -335,7 +335,7 @@ public async Task TestDeleteData()
335335
await session_pool.DeleteDataAsync(ts_path_lst, 2, 3);
336336
res = await session_pool.ExecuteQueryStatementAsync(
337337
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
338-
UtilsTest.PrintDataSetByString(res);
338+
SessionPoolTest.PrintDataSetByString(res);
339339

340340
await res.Close();
341341
status = await session_pool.DeleteDatabaseAsync(testDatabaseName);
@@ -373,7 +373,7 @@ await session_pool.ExecuteNonQueryStatementAsync(
373373
var res = await session_pool.ExecuteQueryStatementAsync(
374374
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
375375

376-
UtilsTest.PrintDataSetByString(res);
376+
SessionPoolTest.PrintDataSetByString(res);
377377

378378
await res.Close();
379379
status = await session_pool.DeleteDatabaseAsync(testDatabaseName);
@@ -450,28 +450,28 @@ await session_pool.ExecuteNonQueryStatementAsync(
450450
"insert into " + string.Format("{0}.{1}", testDatabaseName, testDevice) + "(timestamp, status, hardware) VALUES (7, true,'lz')");
451451

452452
var res = await session_pool.ExecuteQueryStatementAsync("show timeseries root");
453-
UtilsTest.PrintDataSetByString(res);
453+
SessionPoolTest.PrintDataSetByString(res);
454454

455455
await res.Close();
456456
Console.WriteLine("SHOW TIMESERIES ROOT sql passed!");
457457
res = await session_pool.ExecuteQueryStatementAsync("show devices");
458-
UtilsTest.PrintDataSetByString(res);
458+
SessionPoolTest.PrintDataSetByString(res);
459459

460460
await res.Close();
461461
Console.WriteLine("SHOW DEVICES sql passed!");
462462
res = await session_pool.ExecuteQueryStatementAsync($"COUNT TIMESERIES {testDatabaseName}");
463-
UtilsTest.PrintDataSetByString(res);
463+
SessionPoolTest.PrintDataSetByString(res);
464464

465465
await res.Close();
466466
Console.WriteLine("COUNT TIMESERIES root sql Passed");
467467
res = await session_pool.ExecuteQueryStatementAsync("select * from root.ln.wf01 where time<10");
468-
UtilsTest.PrintDataSetByString(res);
468+
SessionPoolTest.PrintDataSetByString(res);
469469

470470
await res.Close();
471471
Console.WriteLine("SELECT sql Passed");
472472
res = await session_pool.ExecuteQueryStatementAsync(
473473
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10");
474-
UtilsTest.PrintDataSetByString(res);
474+
SessionPoolTest.PrintDataSetByString(res);
475475

476476
await res.Close();
477477
status = await session_pool.DeleteDatabaseAsync(testDatabaseName);

0 commit comments

Comments
 (0)