This is an automated email from the ASF dual-hosted git repository.

curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new b2a9f98b07 GH-45752: [C#] Update FlightInfo.cs with missing fields 
(#45753)
b2a9f98b07 is described below

commit b2a9f98b07d18dffc0581eb43d838fd67103973d
Author: Christoph <[email protected]>
AuthorDate: Sun Mar 16 21:29:41 2025 +0100

    GH-45752: [C#] Update FlightInfo.cs with missing fields (#45753)
    
    
    ### What changes are included in this PR?
    
    add ordered and AppMetaData to FlightInfo.cs 
[#45752](https://github.com/apache/arrow/issues/45752)
    
    ### Are these changes tested?
    
    YES
    
    ### Are there any user-facing changes?
    
    NO
    * GitHub Issue: #45752
    
    Lead-authored-by: Christoph <[email protected]>
    Co-authored-by: Christoph Mettler <[email protected]>
    Signed-off-by: Curt Hagenlocher <[email protected]>
---
 csharp/src/Apache.Arrow.Flight/FlightInfo.cs         | 20 +++++++++++++++++---
 .../Apache.Arrow.Flight.Tests/FlightInfoComparer.cs  |  5 +++++
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/csharp/src/Apache.Arrow.Flight/FlightInfo.cs 
b/csharp/src/Apache.Arrow.Flight/FlightInfo.cs
index e2452ac9ff..22cd219b40 100644
--- a/csharp/src/Apache.Arrow.Flight/FlightInfo.cs
+++ b/csharp/src/Apache.Arrow.Flight/FlightInfo.cs
@@ -38,15 +38,22 @@ namespace Apache.Arrow.Flight
 
             TotalBytes = flightInfo.TotalBytes;
             TotalRecords = flightInfo.TotalRecords;
+            Ordered = flightInfo.Ordered;
+            AppMetadata = flightInfo.AppMetadata;
+        }
+        public FlightInfo(Schema schema, FlightDescriptor descriptor, 
IReadOnlyList<FlightEndpoint> endpoints, long totalRecords = -1, long 
totalBytes = 
-1):this(schema,descriptor,endpoints,totalRecords,totalBytes,false, 
ByteString.Empty)
+        {
         }
 
-        public FlightInfo(Schema schema, FlightDescriptor descriptor, 
IReadOnlyList<FlightEndpoint> endpoints, long totalRecords = -1, long 
totalBytes = -1)
+        public FlightInfo(Schema schema, FlightDescriptor descriptor, 
IReadOnlyList<FlightEndpoint> 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 @@ namespace Apache.Arrow.Flight
 
         public long TotalRecords { get; }
 
+        public bool Ordered { get; }
+
+        public ByteString AppMetadata { get; }
+
         public IReadOnlyList<FlightEndpoint> 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 b92e5c4ccc..8f3af17d20 100644
--- a/csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs
+++ b/csharp/test/Apache.Arrow.Flight.Tests/FlightInfoComparer.cs
@@ -34,6 +34,11 @@ namespace Apache.Arrow.Flight.Tests
             Assert.Equal(expected.TotalBytes, actual.TotalBytes);
 
             Assert.Equal(expected.TotalRecords, actual.TotalRecords);
+
+            Assert.Equal(expected.Ordered, actual.Ordered);
+
+            Assert.Equal(expected.AppMetadata, actual.AppMetadata);
+            
         }
     }
 }

Reply via email to