| 376 | Status Init() override { return this->MakeConcreteBuilder(&builder_); } |
| 377 | |
| 378 | Status AppendValue(sj::value& json_obj) override { |
| 379 | ARROW_ASSIGN_OR_RAISE(bool is_null, internal::IsJsonNull(json_obj)); |
| 380 | if (is_null) { |
| 381 | return this->AppendNull(); |
| 382 | } |
| 383 | ARROW_ASSIGN_OR_RAISE(auto string_value, |
| 384 | internal::GetJsonAs<std::string_view>(json_obj)); |
| 385 | int32_t precision, scale; |
| 386 | DecimalValue d; |
| 387 | RETURN_NOT_OK(DecimalValue::FromString(string_value, &d, &precision, &scale)); |
| 388 | if (scale != decimal_type_->scale()) { |
| 389 | return Status::Invalid("Invalid scale for decimal: expected ", |
| 390 | decimal_type_->scale(), ", got ", scale); |
| 391 | } |
| 392 | return builder_->Append(d); |
| 393 | } |
| 394 | |
| 395 | std::shared_ptr<ArrayBuilder> builder() override { return builder_; } |
| 396 |
nothing calls this directly
no test coverage detected