-
Notifications
You must be signed in to change notification settings - Fork 0
Add TSBlock #1
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 TSBlock #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the TsBlock abstraction for batched time-series data, integrates it into the session data flow, and extends the buffer utilities.
- Implemented
TsBlock
class withDeserialize
support and new column decoders - Added
RpcDataSet
for RPC-based query result handling and updatedSessionDataSet
- Extended
ByteBuffer
with aGetBytesbyLength
helper and updatedSessionPool
variable naming
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/Apache.IoTDB/SessionPool.cs | Renamed local dataset variable |
src/Apache.IoTDB/DataStructure/TsBlock.cs | Added TsBlock and deserialization logic |
src/Apache.IoTDB/DataStructure/SessionDataSet.cs | Introduced unused _rpcDataSet field and formatting changes |
src/Apache.IoTDB/DataStructure/RpcDataSet.cs | New RPC dataset handling class |
src/Apache.IoTDB/DataStructure/Column_decoder.cs | Added column decoder framework |
src/Apache.IoTDB/DataStructure/ByteBuffer.cs | Added GetBytesbyLength method |
Comments suppressed due to low confidence (3)
src/Apache.IoTDB/SessionPool.cs:713
- Local variable 'SessionDataSet' should use camelCase (e.g., 'sessionDataSet') to avoid confusion with the class name.
var SessionDataSet = await ExecuteQueryStatementAsync(sql);
src/Apache.IoTDB/DataStructure/ByteBuffer.cs:149
- [nitpick] Method name 'GetBytesbyLength' should use consistent PascalCase ('GetBytesByLength') to align with .NET naming conventions.
public byte[] GetBytesbyLength(int length)
src/Apache.IoTDB/DataStructure/TsBlock.cs:24
- Consider adding unit tests for TsBlock.Deserialize (and related decoders) to verify correct deserialization of various data types and encodings.
public static TsBlock Deserialize(ByteBuffer reader)
Close().Wait(); | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fetching new results, the response payload is never assigned to '_queryResult'; you should update '_queryResult' with the new data (e.g., ' _queryResult = resp.ResultsList') before resetting the index.
_queryResult = resp.ResultsList; |
Copilot uses AI. Check for mistakes.
@@ -454,8 +453,7 @@ public async Task TestInsertAlignedStringRecordsOfOneDevice() | |||
System.Diagnostics.Debug.Assert(status == 0); | |||
var res = await session_pool.ExecuteQueryStatementAsync( | |||
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); | |||
res.ShowTableNames(); | |||
while (res.HasNext()) Console.WriteLine(res.Next()); | |||
UtilsTest.PrintDataSet2(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个名称不太符合命名规范,可以稍微改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
分别改成PrintDatasetByType、PrintDatasetByObject、PrintDatasetByString
{ | ||
res.Next(); | ||
Console.WriteLine(res.GetRow()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里和原来的语义保持一致吧,不打印
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved
@@ -54,8 +54,7 @@ public async Task TestInsertAlignedTablet() | |||
System.Diagnostics.Debug.Assert(status == 0); | |||
var res = await session_pool.ExecuteQueryStatementAsync( | |||
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<15"); | |||
res.ShowTableNames(); | |||
while (res.HasNext()) Console.WriteLine(res.Next()); | |||
UtilsTest.PrintDataSet2(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved
@@ -307,8 +305,7 @@ public async Task TestTestInsertTablets() | |||
// System.Diagnostics.Debug.Assert(status == 0); | |||
var res = await session_pool.ExecuteQueryStatementAsync( | |||
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevices[1]) + " where time<15"); | |||
res.ShowTableNames(); | |||
while (res.HasNext()) Console.WriteLine(res.Next()); | |||
UtilsTest.PrintDataSet2(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
{ | ||
res.Next(); | ||
Console.WriteLine(res.GetRow()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
@@ -324,8 +324,7 @@ public async Task TestDeleteData() | |||
System.Diagnostics.Debug.Assert(status == 0); | |||
var res = await session_pool.ExecuteQueryStatementAsync( | |||
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); | |||
res.ShowTableNames(); | |||
while (res.HasNext()) Console.WriteLine(res.Next()); | |||
UtilsTest.PrintDataSet2(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
@@ -336,8 +335,7 @@ public async Task TestDeleteData() | |||
await session_pool.DeleteDataAsync(ts_path_lst, 2, 3); | |||
res = await session_pool.ExecuteQueryStatementAsync( | |||
"select * from " + string.Format("{0}.{1}", testDatabaseName, testDevice) + " where time<10"); | |||
res.ShowTableNames(); | |||
while (res.HasNext()) Console.WriteLine(res.Next()); | |||
UtilsTest.PrintDataSet2(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
res.ShowTableNames(); | ||
while (res.HasNext()) Console.WriteLine(res.Next()); | ||
|
||
UtilsTest.PrintDataSet2(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里语义相同
No description provided.