MCPcopy Create free account
hub / github.com/apache/arrow / FieldsFromProto

Function FieldsFromProto

cpp/src/arrow/engine/substrait/type_internal.cc:72–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71template <typename Types, typename NextName>
72Result<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

Callers

nothing calls this directly

Calls 6

struct_Function · 0.85
IsNullableFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70
FromProtoFunction · 0.70
fieldFunction · 0.50
GetMethod · 0.45

Tested by

no test coverage detected