| 361 | Status Init() override { return this->MakeConcreteBuilder(&builder_); } |
| 362 | |
| 363 | Status AppendValue(const rj::Value& json_obj) override { |
| 364 | if (json_obj.IsNull()) { |
| 365 | return this->AppendNull(); |
| 366 | } |
| 367 | if (json_obj.IsString()) { |
| 368 | int32_t precision, scale; |
| 369 | DecimalValue d; |
| 370 | auto view = std::string_view(json_obj.GetString(), json_obj.GetStringLength()); |
| 371 | RETURN_NOT_OK(DecimalValue::FromString(view, &d, &precision, &scale)); |
| 372 | if (scale != decimal_type_->scale()) { |
| 373 | return Status::Invalid("Invalid scale for decimal: expected ", |
| 374 | decimal_type_->scale(), ", got ", scale); |
| 375 | } |
| 376 | return builder_->Append(d); |
| 377 | } |
| 378 | return JSONTypeError("decimal string", json_obj.GetType()); |
| 379 | } |
| 380 | |
| 381 | std::shared_ptr<ArrayBuilder> builder() override { return builder_; } |
| 382 |
nothing calls this directly
no test coverage detected