internal static Schema GetSchema(Flatbuf.Schema schema) { var schemaBuilder = new Schema.Builder(); for (int i = 0; i < schema.FieldsLength; i++) { Flatbuf.Field field = schema.Fields(i).GetValueOrDefault(); schemaBuilder.Field(FieldFromFlatbuffer(field)); } return(schemaBuilder.Build()); }
internal static Schema GetSchema(Flatbuf.Schema schema) { var schemaBuilder = new Schema.Builder(); for (var i = 0; i < schema.FieldsLength; i++) { var field = schema.Fields(i).GetValueOrDefault(); schemaBuilder.Field( new Field(field.Name, GetFieldArrowType(field), field.Nullable)); } return(schemaBuilder.Build()); }
internal static Schema GetSchema(Flatbuf.Schema schema, ref DictionaryMemo dictionaryMemo) { List <Field> fields = new List <Field>(); for (int i = 0; i < schema.FieldsLength; i++) { Flatbuf.Field field = schema.Fields(i).GetValueOrDefault(); fields.Add(FieldFromFlatbuffer(field, ref dictionaryMemo)); } Dictionary <string, string> metadata = schema.CustomMetadataLength > 0 ? new Dictionary <string, string>() : null; for (int i = 0; i < schema.CustomMetadataLength; i++) { Flatbuf.KeyValue keyValue = schema.CustomMetadata(i).GetValueOrDefault(); metadata[keyValue.Key] = keyValue.Value; } return(new Schema(fields, metadata, copyCollections: false)); }