diff --git a/csharp/src/Apache.Arrow.Flight/FlightInfo.cs b/csharp/src/Apache.Arrow.Flight/FlightInfo.cs index e2452ac9ff4..22cd219b40f 100644 --- a/csharp/src/Apache.Arrow.Flight/FlightInfo.cs +++ b/csharp/src/Apache.Arrow.Flight/FlightInfo.cs @@ -38,15 +38,22 @@ internal FlightInfo(Protocol.FlightInfo flightInfo) TotalBytes = flightInfo.TotalBytes; TotalRecords = flightInfo.TotalRecords; + Ordered = flightInfo.Ordered; + AppMetadata = flightInfo.AppMetadata; + } + public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList endpoints, long totalRecords = -1, long totalBytes = -1):this(schema,descriptor,endpoints,totalRecords,totalBytes,false, ByteString.Empty) + { } - public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList endpoints, long totalRecords = -1, long totalBytes = -1) + public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList endpoints, long totalRecords, long totalBytes, bool ordered = false, ByteString appMetadata=null) { Schema = schema; Descriptor = descriptor; Endpoints = endpoints; TotalBytes = totalBytes; TotalRecords = totalRecords; + Ordered = ordered; + AppMetadata = appMetadata ?? ByteString.Empty; } public FlightDescriptor Descriptor { get; } @@ -57,20 +64,27 @@ public FlightInfo(Schema schema, FlightDescriptor descriptor, IReadOnlyList Endpoints { get; } internal Protocol.FlightInfo ToProtocol() { var serializedSchema = Schema != null ? SchemaWriter.SerializeSchema(Schema) : ByteString.Empty; + var response = new Protocol.FlightInfo() { Schema = serializedSchema, FlightDescriptor = Descriptor.ToProtocol(), TotalBytes = TotalBytes, - TotalRecords = TotalRecords + TotalRecords = TotalRecords, + Ordered = Ordered, + AppMetadata = AppMetadata }; - foreach(var endpoint in Endpoints) + foreach (var endpoint in Endpoints) { response.Endpoint.Add(endpoint.ToProtocol()); } diff --git a/csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs b/csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs index b92e5c4ccc2..8f3af17d20b 100644 --- a/csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs +++ b/csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs @@ -34,6 +34,11 @@ public static void Compare(FlightInfo expected, FlightInfo actual) Assert.Equal(expected.TotalBytes, actual.TotalBytes); Assert.Equal(expected.TotalRecords, actual.TotalRecords); + + Assert.Equal(expected.Ordered, actual.Ordered); + + Assert.Equal(expected.AppMetadata, actual.AppMetadata); + } } }