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

Method AppendValue

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

Source from the content-addressed store, hash-verified

542 Status Init() override { return this->MakeConcreteBuilder(&builder_); }
543
544 Status AppendValue(const rj::Value& json_obj) override {
545 if (json_obj.IsNull()) {
546 return this->AppendNull();
547 }
548 if (json_obj.IsString()) {
549 auto view = std::string_view(json_obj.GetString(), json_obj.GetStringLength());
550 if (view.length() != static_cast<size_t>(builder_->byte_width())) {
551 std::stringstream ss;
552 ss << "Invalid string length " << view.length() << " in JSON input for "
553 << this->type_->ToString();
554 return Status::Invalid(ss.str());
555 }
556 return builder_->Append(view);
557 } else {
558 return JSONTypeError("string", json_obj.GetType());
559 }
560 }
561
562 std::shared_ptr<ArrayBuilder> builder() override { return builder_; }
563

Callers

nothing calls this directly

Calls 11

JSONTypeErrorFunction · 0.85
strMethod · 0.80
InvalidFunction · 0.50
IsNullMethod · 0.45
AppendNullMethod · 0.45
GetStringMethod · 0.45
lengthMethod · 0.45
byte_widthMethod · 0.45
ToStringMethod · 0.45
AppendMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected