You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/10/06 00:49:29 UTC

[GitHub] [arrow] eerhardt commented on a change in pull request #8348: ARROW-6972: [C#] Support for StructArrays

eerhardt commented on a change in pull request #8348:
URL: https://github.com/apache/arrow/pull/8348#discussion_r499947637



##########
File path: csharp/src/Apache.Arrow/Ipc/MessageSerializer.cs
##########
@@ -57,16 +58,30 @@ internal static Schema GetSchema(Flatbuf.Schema schema)
             for (int i = 0; i < schema.FieldsLength; i++)
             {
                 Flatbuf.Field field = schema.Fields(i).GetValueOrDefault();
-
-                schemaBuilder.Field(
-                    new Field(field.Name, GetFieldArrowType(field), field.Nullable));
+                Field arrowField = FieldFromFlatbuffer(field);
+                schemaBuilder.Field(arrowField);
             }
 
             return schemaBuilder.Build();
         }
 
+        private static Field FieldFromFlatbuffer(Flatbuf.Field flatbufField)
+        {
+            System.Collections.Generic.List<Field> childFields = null;
+            if (flatbufField.ChildrenLength > 0)
+            {
+                childFields = new System.Collections.Generic.List<Field>();

Review comment:
       It wouldn’t need to make a List in the constructor since the ctor now takes an IReadOnlyList. It could just hang on to that.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org