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

Method Make

cpp/src/arrow/scalar.cc:707–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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