| 70 | |
| 71 | template <typename Types, typename NextName> |
| 72 | Result<FieldVector> FieldsFromProto(int size, const Types& types, |
| 73 | const NextName& next_name, |
| 74 | const ExtensionSet& ext_set, |
| 75 | const ConversionOptions& conversion_options) { |
| 76 | FieldVector fields(size); |
| 77 | for (int i = 0; i < size; ++i) { |
| 78 | std::string name = next_name(); |
| 79 | std::shared_ptr<DataType> type; |
| 80 | bool nullable; |
| 81 | |
| 82 | if (types.Get(i).has_struct_()) { |
| 83 | const auto& struct_ = types.Get(i).struct_(); |
| 84 | |
| 85 | ARROW_ASSIGN_OR_RAISE( |
| 86 | auto fields, FieldsFromProto(struct_.types_size(), struct_.types(), next_name, |
| 87 | ext_set, conversion_options)); |
| 88 | type = ::arrow::struct_(std::move(fields)); |
| 89 | |
| 90 | nullable = IsNullable(struct_); |
| 91 | } else { |
| 92 | ARROW_ASSIGN_OR_RAISE(std::tie(type, nullable), |
| 93 | FromProto(types.Get(i), ext_set, conversion_options)); |
| 94 | } |
| 95 | |
| 96 | fields[i] = field(std::move(name), std::move(type), nullable); |
| 97 | } |
| 98 | return fields; |
| 99 | } |
| 100 | |
| 101 | } // namespace |
| 102 |
nothing calls this directly
no test coverage detected