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

Method Make

cpp/src/arrow/scalar.cc:709–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

707 is_valid) {}
708
709Result<std::shared_ptr<StructScalar>> StructScalar::Make(
710 ScalarVector values, std::vector<std::string> field_names) {
711 if (values.size() != field_names.size()) {
712 return Status::Invalid("Mismatching number of field names and child scalars");
713 }
714
715 FieldVector fields(field_names.size());
716 for (size_t i = 0; i < fields.size(); ++i) {
717 fields[i] = arrow::field(std::move(field_names[i]), values[i]->type);
718 }
719
720 return std::make_shared<StructScalar>(std::move(values), struct_(std::move(fields)));
721}
722
723Result<std::shared_ptr<Scalar>> StructScalar::field(FieldRef ref) const {
724 ARROW_ASSIGN_OR_RAISE(auto path, ref.FindOne(*type));

Callers

nothing calls this directly

Calls 6

struct_Function · 0.85
InvalidFunction · 0.70
fieldFunction · 0.70
dictionaryFunction · 0.70
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected