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

Function TopLevelIndex

cpp/src/arrow/dataset/file_json.cc:186–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186int TopLevelIndex(const FieldRef& ref, const Schema& schema) {
187 if (const auto* name = ref.name()) {
188 return schema.GetFieldIndex(*name);
189 } else if (const auto* path = ref.field_path()) {
190 DCHECK(!path->empty());
191 return (*path)[0];
192 }
193 const auto* nested_refs = ref.nested_refs();
194 DCHECK(nested_refs && !nested_refs->empty());
195 return TopLevelIndex((*nested_refs)[0], schema);
196}
197
198// Make a new schema consisting only of the top-level fields in the dataset schema that:
199// (a) Have children that require materialization

Callers 1

GetPartialSchemaFunction · 0.85

Calls 3

nameMethod · 0.45
GetFieldIndexMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected