Skip to content
4 changes: 2 additions & 2 deletions samples/Apache.IoTDB.Samples/SessionPoolTest.AlignedRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public async Task TestInsertAlignedRecords()
while (res.Next())
{
res_count += 1;
Console.WriteLine(res.GetRow());
Console.WriteLine(res.Next());
}

await res.Close();
Expand Down Expand Up @@ -299,7 +299,7 @@ public async Task TestInsertAlignedStringRecords()
var res_count = 0;
while (res.Next())
{
Console.WriteLine(res.GetRow());
Console.WriteLine(res.Next());
res_count += 1;
}

Expand Down
2 changes: 1 addition & 1 deletion samples/Apache.IoTDB.Samples/SessionPoolTest.Record.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public async Task TestInsertStringRecords()
var res_count = 0;
while (res.Next())
{
Console.WriteLine(res.GetRow());
Console.WriteLine(res.Next());
res_count += 1;
}

Expand Down
2 changes: 1 addition & 1 deletion samples/Apache.IoTDB.Samples/SessionPoolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ public async Task TestMultiNodeDataFetch()
Console.WriteLine();

var count = 0;
while (res.Next()) count++;
while (res.HasNext()) count++;

Console.WriteLine(count + " " + (fetchSize * processedSize * 4 + 783));
System.Diagnostics.Debug.Assert(count == fetchSize * processedSize * 4 + 783);
Expand Down
6 changes: 3 additions & 3 deletions samples/Apache.IoTDB.Samples/UtilsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static public void PrintDataSetByType(SessionDataSet sessionDataSet)
}
Console.WriteLine();

while (sessionDataSet.Next())
while (sessionDataSet.HasNext())
{
for (int i = 0; i < columns.Count; i++)
{
Expand Down Expand Up @@ -147,7 +147,7 @@ static public void PrintDataSetByObject(SessionDataSet sessionDataSet)
}
Console.WriteLine();

while (sessionDataSet.Next())
while (sessionDataSet.HasNext())
{
for (int i = 0; i < columns.Count; i++)
{
Expand All @@ -169,7 +169,7 @@ static public void PrintDataSetByString(SessionDataSet sessionDataSet)
}
Console.WriteLine();

while (sessionDataSet.Next())
while (sessionDataSet.HasNext())
{
for (int i = 0; i < columns.Count; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.IoTDB.Data/IoTDBDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public override DataTable GetSchemaTable()
{
if (_dataSet.Next())
{
rowdata = _dataSet.GetRow();
rowdata = _dataSet.Next();
}
var schemaTable = new DataTable("SchemaTable");
if (_metas != null && rowdata != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.IoTDB/DataStructure/ByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public byte[] GetBuffer()
return _buffer[.._writePos];
}

public byte[] GetBytesbyLength(int length)
public byte[] GetBytesByLengthh(int length)
{
if (_readPos + length > _buffer.Length)
throw new ArgumentOutOfRangeException(nameof(length),
Expand Down
12 changes: 6 additions & 6 deletions src/Apache.IoTDB/DataStructure/Column.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public BinaryColumn(int arrayOffset, int positionCount, bool[] valueIsNull, Bina
ColumnEncoding.BinaryArray,
arrayOffset: arrayOffset,
positionCount: positionCount,
valueIsNull: null,
valueIsNull: valueIsNull,
values: values)
{ }

Expand All @@ -193,7 +193,7 @@ public IntColumn(int arrayOffset, int positionCount, bool[] valueIsNull, int[] v
ColumnEncoding.Int32Array,
arrayOffset: arrayOffset,
positionCount: positionCount,
valueIsNull: null,
valueIsNull: valueIsNull,
values: values)
{ }

Expand All @@ -211,7 +211,7 @@ public FloatColumn(int arrayOffset, int positionCount, bool[] valueIsNull, float
ColumnEncoding.Int32Array,
arrayOffset: arrayOffset,
positionCount: positionCount,
valueIsNull: null,
valueIsNull: valueIsNull,
values: values)
{ }

Expand All @@ -229,7 +229,7 @@ public LongColumn(int arrayOffset, int positionCount, bool[] valueIsNull, long[]
ColumnEncoding.Int64Array,
arrayOffset: arrayOffset,
positionCount: positionCount,
valueIsNull: null,
valueIsNull: valueIsNull,
values: values)
{ }

Expand All @@ -247,7 +247,7 @@ public DoubleColumn(int arrayOffset, int positionCount, bool[] valueIsNull, doub
ColumnEncoding.Int64Array,
arrayOffset: arrayOffset,
positionCount: positionCount,
valueIsNull: null,
valueIsNull: valueIsNull,
values: values)
{ }

Expand All @@ -265,7 +265,7 @@ public BooleanColumn(int arrayOffset, int positionCount, bool[] valueIsNull, boo
ColumnEncoding.ByteArray,
arrayOffset: arrayOffset,
positionCount: positionCount,
valueIsNull: null,
valueIsNull: valueIsNull,
values: values)
{ }

Expand Down
4 changes: 2 additions & 2 deletions src/Apache.IoTDB/DataStructure/ColumnDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static bool[] DeserializeNullIndicators(ByteBuffer reader, int positionCo
public static bool[] DeserializeBooleanArray(ByteBuffer reader, int size)
{
int packedSize = (size + 7) / 8;
byte[] packedBytes = reader.GetBytesbyLength(packedSize);
byte[] packedBytes = reader.GetBytesByLengthh(packedSize);
if (packedBytes.Length < packedSize)
throw new InvalidDataException(
$"Boolean array decoding failed: expected {packedSize} bytes for {size} bits, but only received {packedBytes.Length} bytes from buffer."
Expand Down Expand Up @@ -199,7 +199,7 @@ public Column ReadColumn(ByteBuffer reader, TSDataType dataType, int positionCou
if (nullIndicators != null && nullIndicators[i])
continue;
int length = reader.GetInt();
byte[] value = reader.GetBytesbyLength(length);
byte[] value = reader.GetBytesByLengthh(length);
values[i] = new Binary(value);
}

Expand Down
5 changes: 2 additions & 3 deletions src/Apache.IoTDB/DataStructure/RpcDataSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
public int _tsBlockSize;
private int _tsBlockIndex;
private TimeZoneInfo _zoneId;
private int _timeFactor;

Check warning on line 63 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Field 'RpcDataSet._timeFactor' is never assigned to, and will always have its default value 0

Check warning on line 63 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Field 'RpcDataSet._timeFactor' is never assigned to, and will always have its default value 0

Check warning on line 63 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Field 'RpcDataSet._timeFactor' is never assigned to, and will always have its default value 0
private string _timePrecision;

Check warning on line 64 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Field 'RpcDataSet._timePrecision' is never assigned to, and will always have its default value null

Check warning on line 64 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Field 'RpcDataSet._timePrecision' is never assigned to, and will always have its default value null

Check warning on line 64 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

Field 'RpcDataSet._timePrecision' is never assigned to, and will always have its default value null
private bool disposedValue;

public RpcDataSet(string sql, List<string> columnNameList, List<string> columnTypeList,
Expand Down Expand Up @@ -185,7 +185,7 @@

try
{
var status = await _client.ServiceClient.closeOperation(closeRequest);
var status = await _client.ServiceClient.closeOperationAsync(closeRequest);

Check failure on line 188 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'closeOperationAsync' and no accessible extension method 'closeOperationAsync' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)
}
catch (TException e)
{
Expand Down Expand Up @@ -242,8 +242,7 @@

try
{
var task = _client.ServiceClient.fetchResultsV2(req);

var task = _client.ServiceClient.fetchResultsV2Async(req);

Check failure on line 245 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'fetchResultsV2Async' and no accessible extension method 'fetchResultsV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)
var resp = task.ConfigureAwait(false).GetAwaiter().GetResult();

if (!resp.HasResultSet)
Expand Down Expand Up @@ -667,7 +666,7 @@
fieldList.Add(localfield);
i += 1;
}
return new RowRecord(timestamp, fieldList, _columnNameList);

Check warning on line 669 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'RowRecord.RowRecord(long, List<object>, List<string>)' is obsolete: 'Use the constructor with List<TSDataType> instead'

Check warning on line 669 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'RowRecord.RowRecord(long, List<object>, List<string>)' is obsolete: 'Use the constructor with List<TSDataType> instead'

Check warning on line 669 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'RowRecord.RowRecord(long, List<object>, List<string>)' is obsolete: 'Use the constructor with List<TSDataType> instead'

Check warning on line 669 in src/Apache.IoTDB/DataStructure/RpcDataSet.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'RowRecord.RowRecord(long, List<object>, List<string>)' is obsolete: 'Use the constructor with List<TSDataType> instead'
}

public DateTime GetTimestampByIndex(int columnIndex)
Expand Down
25 changes: 5 additions & 20 deletions src/Apache.IoTDB/DataStructure/SessionDataSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ public class SessionDataSet : System.IDisposable
private readonly List<string> _columnNames;
private readonly Dictionary<string, int> _columnNameIndexMap;
private readonly List<string> _columnTypeLst;
private readonly int _columnSize;
private List<ByteBuffer> _valueBufferLst, _bitmapBufferLst;
private Client _client;
private int _rowIndex;
private RowRecord _cachedRowRecord;
private bool _isClosed = false;
private bool disposedValue;
private RpcDataSet _rpcDataSet;
Expand All @@ -52,35 +48,28 @@ public class SessionDataSet : System.IDisposable
public SessionDataSet(
string sql, List<string> ColumnNameList, List<string> ColumnTypeList,
Dictionary<string, int> ColumnNameIndexMap, long QueryId, long statementId, Client client, List<byte[]> QueryResult,
bool IgnoreTimeStamp, bool MoreData, string zoneId, List<int> ColumnIndex2TsBlockColumnIndexList, ConcurrentClientQueue _clientQueueS
bool IgnoreTimeStamp, bool MoreData, string zoneId, List<int> ColumnIndex2TsBlockColumnIndexList, ConcurrentClientQueue clientQueue
)
{
_client = client;
_sql = sql;
_queryId = QueryId;
_statementId = statementId;
_columnSize = ColumnNameList.Count;
_columnNameIndexMap = ColumnNameIndexMap;
_rowIndex = 0;

_columnNames = ColumnNameList;
_columnTypeLst = ColumnTypeList;
_zoneId = zoneId;
_clientQueue = _clientQueueS;

_clientQueue = clientQueue;
_rpcDataSet = new RpcDataSet(
_sql, _columnNames, _columnTypeLst, _columnNameIndexMap, IgnoreTimeStamp,
MoreData, _queryId, _statementId, _client, _client.SessionId, QueryResult, FetchSize,
DefaultTimeout, _zoneId, ColumnIndex2TsBlockColumnIndexList
);
}
public bool HasNext()
{
if (_rpcDataSet.HasCachedRecord) return true;
return Next();
}

public bool Next() => _rpcDataSet.Next();
public bool HasNext() => _rpcDataSet.Next();
public RowRecord Next() => _rpcDataSet.GetRow();
public bool IsNull(string columnName) => _rpcDataSet.IsNullByColumnName(columnName);
public bool IsNullByIndex(int columnIndex) => _rpcDataSet.IsNullByIndex(columnIndex);

Expand Down Expand Up @@ -119,9 +108,7 @@ public bool HasNext()
public IReadOnlyList<string> GetColumnNames() => _rpcDataSet._columnNameList;
public IReadOnlyList<string> GetColumnTypes() => _rpcDataSet._columnTypeList;

public RowRecord GetRow() => _rpcDataSet.GetRow();
public int RowCount() => _rpcDataSet._tsBlockSize;

public void ShowTableNames()
{
IReadOnlyList<string> columns = GetColumnNames();
Expand Down Expand Up @@ -173,8 +160,6 @@ protected virtual void Dispose(bool disposing)
{
}
}
_valueBufferLst = null;
_bitmapBufferLst = null;
disposedValue = true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Apache.IoTDB/DataStructure/TsBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public static TsBlock Deserialize(ByteBuffer reader)
ColumnEncoding timeColumnEncodings = DeserializeColumnEncoding(reader);

// Read value column encodings
var valuecolumnEncodings = new ColumnEncoding[valueColumnCount];
var valueColumnEncodings = new ColumnEncoding[valueColumnCount];
for (int i = 1; i < valueColumnCount + 1; i++)
{
valuecolumnEncodings[i - 1] = DeserializeColumnEncoding(reader);
valueColumnEncodings[i - 1] = DeserializeColumnEncoding(reader);
}

// Read time column
Expand All @@ -91,7 +91,7 @@ public static TsBlock Deserialize(ByteBuffer reader)
var valueColumns = new Column[valueColumnCount];
for (int i = 1; i < valueColumnCount + 1; i++)
{
var decoder = BaseColumnDecoder.GetDecoder(valuecolumnEncodings[i - 1]);
var decoder = BaseColumnDecoder.GetDecoder(valueColumnEncodings[i - 1]);
valueColumns[i - 1] = decoder.ReadColumn(reader, valueColumnDataTypes[i - 1], positionCount);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Apache.IoTDB/SessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@
Timeout = timeoutInMs
};

var resp = await client.ServiceClient.executeQueryStatementV2(req);
var resp = await client.ServiceClient.executeQueryStatementV2Async(req);

Check failure on line 1330 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeQueryStatementV2Async' and no accessible extension method 'executeQueryStatementV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 1330 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeQueryStatementV2Async' and no accessible extension method 'executeQueryStatementV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)
var status = resp.Status;

if (_utilFunctions.VerifySuccess(status) == -1)
Expand Down Expand Up @@ -1360,7 +1360,7 @@
Timeout = timeout
};

var resp = await client.ServiceClient.executeStatementV2(req);
var resp = await client.ServiceClient.executeStatementV2Async(req);

Check failure on line 1363 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeStatementV2Async' and no accessible extension method 'executeStatementV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 1363 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeStatementV2Async' and no accessible extension method 'executeStatementV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)
var status = resp.Status;

if (_utilFunctions.VerifySuccess(status) == -1)
Expand Down Expand Up @@ -1440,7 +1440,7 @@
EnableRedirectQuery = false
};

var resp = await client.ServiceClient.executeRawDataQueryV2(req);
var resp = await client.ServiceClient.executeRawDataQueryV2Async(req);

Check failure on line 1443 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeRawDataQueryV2Async' and no accessible extension method 'executeRawDataQueryV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 1443 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeRawDataQueryV2Async' and no accessible extension method 'executeRawDataQueryV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)
var status = resp.Status;

if (_utilFunctions.VerifySuccess(status) == -1)
Expand Down Expand Up @@ -1472,7 +1472,7 @@
EnableRedirectQuery = false
};

var resp = await client.ServiceClient.executeLastDataQueryV2(req);
var resp = await client.ServiceClient.executeLastDataQueryV2Async(req);

Check failure on line 1475 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeLastDataQueryV2Async' and no accessible extension method 'executeLastDataQueryV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 1475 in src/Apache.IoTDB/SessionPool.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

'IClientRPCService.Client' does not contain a definition for 'executeLastDataQueryV2Async' and no accessible extension method 'executeLastDataQueryV2Async' accepting a first argument of type 'IClientRPCService.Client' could be found (are you missing a using directive or an assembly reference?)
var status = resp.Status;

if (_utilFunctions.VerifySuccess(status) == -1)
Expand Down
Loading