CurtHagenlocher commented on code in PR #1317:
URL: https://github.com/apache/arrow-adbc/pull/1317#discussion_r1401132505
##########
csharp/src/Drivers/BigQuery/BigQueryInfoArrowStream.cs:
##########
@@ -28,25 +28,26 @@ namespace Apache.Arrow.Adbc.Drivers.BigQuery
internal class BigQueryInfoArrowStream : IArrowArrayStream
{
private Schema schema;
- private IEnumerable<IArrowArray> data;
- private int length;
+ private RecordBatch batch;
- public BigQueryInfoArrowStream(Schema schema, IEnumerable<IArrowArray>
data, int length)
+ public BigQueryInfoArrowStream(Schema schema, List<IArrowArray> data)
{
this.schema = schema;
- this.data = data;
- this.length = length;
+ this.batch = new RecordBatch(schema, data, data[0].Length);
}
public Schema Schema { get { return this.schema; } }
public ValueTask<RecordBatch>
ReadNextRecordBatchAsync(CancellationToken cancellationToken = default)
{
- return new ValueTask<RecordBatch>(new RecordBatch(schema, data,
length));
+ RecordBatch batch = this.batch;
+ this.batch = null;
+ return new ValueTask<RecordBatch>(batch);
}
public void Dispose()
{
+ this.batch?.Dispose();
Review Comment:
Should set batch to null
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]