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

Method AppendValue

cpp/src/arrow/json/from_string.cc:560–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558 Status Init() override { return this->MakeConcreteBuilder(&builder_); }
559
560 Status AppendValue(sj::value& json_obj) override {
561 ARROW_ASSIGN_OR_RAISE(bool is_null, internal::IsJsonNull(json_obj));
562 if (is_null) {
563 return this->AppendNull();
564 }
565 ARROW_ASSIGN_OR_RAISE(auto view, internal::GetJsonAs<std::string_view>(json_obj));
566 if (view.length() != static_cast<size_t>(builder_->byte_width())) {
567 std::stringstream ss;
568 ss << "Invalid string length " << view.length() << " in JSON input for "
569 << this->type_->ToString();
570 return Status::Invalid(ss.str());
571 }
572 return builder_->Append(view);
573 }
574
575 std::shared_ptr<ArrayBuilder> builder() override { return builder_; }
576

Callers

nothing calls this directly

Calls 7

strMethod · 0.80
InvalidFunction · 0.50
AppendNullMethod · 0.45
lengthMethod · 0.45
byte_widthMethod · 0.45
ToStringMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected