Skip to content

Conversation

lausannel
Copy link
Collaborator

@lausannel lausannel commented Jun 27, 2025

Introduced a V2 data reading interface based on TSBlock, aligned with the design of the Go client

* add tsblock

* develop tsblock and rpcdataset

* improve code specifications

* develop RpcDataSet api

* coding api in SessionDataSet and rpcDataSet

* fix bugs & pass test

* adapted to IoTDBDataReader

* adopted comments

* add license and change ubuntu version

* format code

---------

Co-authored-by: xxhz22 <1791961174@qq.com>
@lausannel lausannel requested a review from CritasWang June 27, 2025 08:38
@CritasWang CritasWang requested a review from Copilot June 30, 2025 04:13
Copy link

@Copilot Copilot AI left a 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 a V2 data reading interface based on TSBlock and aligns the C# client design with the Go client. Key changes include:

  • Changing default timezone identifiers from "UTC+08:00" to "Asia/Shanghai".
  • Updating SessionPool calls to new RPC methods (dropping Async suffix) and wiring up TSBlock-based streaming.
  • Adding core data‐structure support: TsBlock, RpcDataSet, ColumnDecoder, Column, and extending ByteBuffer.

Reviewed Changes

Copilot reviewed 22 out of 125 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
TableSessionPool.Builder.cs, SessionPool.Builder.cs Updated default _zoneId initialization to "Asia/Shanghai".
SessionPool.cs Swapped deprecated async calls for new V2 methods; updated timezone.
DataStructure/TsBlock.cs Added TsBlock deserialization and validation logic.
DataStructure/RpcDataSet.cs New streaming class to iterate through TSBlocks over RPC V2.
DataStructure/ColumnDecoder.cs, Column.cs Core interfaces and implementations for decoding column data.
DataStructure/ByteBuffer.cs Added GetBytesbyLength helper for length‐based reads.
DataStructure/SessionDataSet.cs Refactored to delegate to RpcDataSet with new constructor.
Client.cs Added GetDataTypeByStr helper for mapping string types to enum.
IoTDBDataReader.cs Updated to use Next()/GetRow() instead of HasNext()/Next().
IoTDBConnectionStringBuilder.cs Updated default _zoneId to "Asia/Shanghai".
samples/… Refactored sample tests to use PrintDataSetByString and Next().
.github/workflows/pre-commit-format.yml Upgraded runner from Ubuntu 20.04 to Ubuntu 22.04.
Comments suppressed due to low confidence (4)

src/Apache.IoTDB/DataStructure/ByteBuffer.cs:149

  • Method name 'GetBytesbyLength' uses inconsistent casing; consider renaming to 'GetBytesByLength' to match .NET naming conventions.
        public byte[] GetBytesbyLength(int length)

src/Apache.IoTDB/DataStructure/SessionDataSet.cs:52

  • [nitpick] Parameter '_clientQueueS' begins with an underscore and uppercase letter, which conflicts with C# parameter naming conventions. Consider renaming to 'clientQueue'.
        public SessionDataSet(

src/Apache.IoTDB/DataStructure/TsBlock.cs:80

  • [nitpick] Variable 'valuecolumnEncodings' should be renamed to 'valueColumnEncodings' to follow camelCase convention and improve readability.
            var valuecolumnEncodings = new ColumnEncoding[valueColumnCount];

src/Apache.IoTDB/DataStructure/RpcDataSet.cs:29

  • Public types and methods lack XML documentation comments. Consider adding summaries to explain usage for key public APIs like RpcDataSet.
    public class RpcDataSet : System.IDisposable

public class IntColumn : PrimitiveColumn<int>
{
public IntColumn(int arrayOffset, int positionCount, bool[] valueIsNull, int[] values)
: base(
Copy link

Copilot AI Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructors ignore the passed 'valueIsNull' array by hardcoding it to null; this discards null-indicator information. Pass the actual 'valueIsNull' parameter to the base class.

Copilot uses AI. Check for mistakes.

@CritasWang
Copy link
Contributor

image
At present, iotdb itself will build csharp's RPC interface during the build process. Is it necessary to update Thrift to 0.15.0. Perhaps it would be better to maintain unity with IoTDB?

lausannel and others added 3 commits August 24, 2025 17:57
* add tsblock

* develop tsblock and rpcdataset

* improve code specifications

* develop RpcDataSet api

* coding api in SessionDataSet and rpcDataSet

* fix bugs & pass test

* adapted to IoTDBDataReader

* adopted comments

* add license and change ubuntu version

* format code

* fix pull request

* fix valueIsNull

---------

Co-authored-by: xxhz22 <1791961174@qq.com>
@lausannel
Copy link
Collaborator Author

lausannel commented Aug 24, 2025

image At present, iotdb itself will build csharp's RPC interface during the build process. Is it necessary to update Thrift to 0.15.0. Perhaps it would be better to maintain unity with IoTDB?

The Thrift version has been reverted to 0.14.1

@lausannel lausannel requested a review from CritasWang August 24, 2025 21:07
@CritasWang CritasWang merged commit bbf0506 into apache:main Aug 26, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants