| 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 |
nothing calls this directly
no test coverage detected