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

Method AppendValue

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

Source from the content-addressed store, hash-verified

474 }
475
476 Status AppendValue(const rj::Value& json_obj) override {
477 if (json_obj.IsNull()) {
478 return this->AppendNull();
479 }
480 MonthDayNanoIntervalType::MonthDayNanos value;
481 if (!json_obj.IsArray()) {
482 return JSONTypeError("array", json_obj.GetType());
483 }
484 if (json_obj.Size() != 3) {
485 return Status::Invalid(
486 "month_day_nano_interval must have exactly 3 elements, had ", json_obj.Size());
487 }
488 RETURN_NOT_OK(ConvertNumber<Int32Type>(json_obj[0], *this->type_, &value.months));
489 RETURN_NOT_OK(ConvertNumber<Int32Type>(json_obj[1], *this->type_, &value.days));
490 RETURN_NOT_OK(
491 ConvertNumber<Int64Type>(json_obj[2], *this->type_, &value.nanoseconds));
492
493 return builder_->Append(value);
494 }
495
496 std::shared_ptr<ArrayBuilder> builder() override { return builder_; }
497

Callers

nothing calls this directly

Calls 7

JSONTypeErrorFunction · 0.85
InvalidFunction · 0.50
IsNullMethod · 0.45
AppendNullMethod · 0.45
GetTypeMethod · 0.45
SizeMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected