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

Method ReadSchema

cpp/src/arrow/ipc/feather.cc:176–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174 }
175
176 Status ReadSchema() {
177 std::vector<std::shared_ptr<Field>> fields;
178 for (int i = 0; i < static_cast<int>(metadata_->columns()->size()); ++i) {
179 const fbs::Column* col = metadata_->columns()->Get(i);
180 std::shared_ptr<DataType> type;
181 RETURN_NOT_OK(
182 GetDataType(col->values(), col->metadata_type(), col->metadata(), &type));
183 fields.push_back(::arrow::field(col->name()->str(), type));
184 }
185 schema_ = ::arrow::schema(std::move(fields));
186 return Status::OK();
187 }
188
189 Status GetDataType(const fbs::PrimitiveArray* values, fbs::TypeMetadata metadata_type,
190 const void* metadata, std::shared_ptr<DataType>* out) {

Callers

nothing calls this directly

Calls 11

columnsMethod · 0.80
push_backMethod · 0.80
strMethod · 0.80
schemaFunction · 0.70
fieldFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45
GetMethod · 0.45
valuesMethod · 0.45
metadataMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected