westonpace commented on code in PR #35222:
URL: https://github.com/apache/arrow/pull/35222#discussion_r1172957597
##########
csharp/test/Apache.Arrow.Flight.Tests/FlightTests.cs:
##########
@@ -312,5 +312,26 @@ await foreach(var recordBatch in getStream.ResponseStream)
ArrowReaderVerifier.CompareBatches(expectedBatch1, resultList[0]);
ArrowReaderVerifier.CompareBatches(expectedBatch2, resultList[1]);
}
+
+ [Fact]
+ public async Task
EnsureTheSerializedBatchContainsTheProperTotalRecordsAndTotalBytesProperties()
+ {
+ var flightDescriptor1 =
FlightDescriptor.CreatePathDescriptor("test1");
+ var expectedBatch = CreateTestBatch(0, 100);
+ var expectedTotalBytes = expectedBatch.Arrays.Sum(arr =>
arr.Data.Buffers.Sum(b => b.Length));
+
+ List<FlightInfo> expectedFlightInfo = new List<FlightInfo>();
+
+ expectedFlightInfo.Add(GivenStoreBatches(flightDescriptor1, new
RecordBatchWithMetadata(expectedBatch)));
+
+ var listFlightStream = _flightClient.ListFlights();
+
+ var actualFlights = await
listFlightStream.ResponseStream.ToListAsync();
+ var result = actualFlights.First();
+
+ //Expected values can be found in the FlightHolder class
Review Comment:
```suggestion
```
I'm not sure this comment is still needed since it appears you moved away
from hard-coded values.
##########
csharp/src/Apache.Arrow.Flight/FlightInfo.cs:
##########
@@ -64,7 +64,9 @@ internal Protocol.FlightInfo ToProtocol()
var response = new Protocol.FlightInfo()
{
Schema = serializedSchema,
- FlightDescriptor = Descriptor.ToProtocol()
+ FlightDescriptor = Descriptor.ToProtocol(),
+ TotalBytes = TotalBytes,
+ TotalRecords = TotalRecords
Review Comment:
This isn't related to your PR but should `totalRecords` and `totalBytes`
default to -1 in the constructor? From
https://arrow.apache.org/docs/format/Flight.html it appears that `-1` is the
value to use for "unknown".
--
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]