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

Method AppendValue

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

Source from the content-addressed store, hash-verified

406 }
407
408 Status AppendValue(const rj::Value& json_obj) override {
409 if (json_obj.IsNull()) {
410 return this->AppendNull();
411 }
412 int64_t value;
413 if (json_obj.IsNumber()) {
414 RETURN_NOT_OK(ConvertNumber<Int64Type>(json_obj, *this->type_, &value));
415 } else if (json_obj.IsString()) {
416 std::string_view view(json_obj.GetString(), json_obj.GetStringLength());
417 if (!ParseValue(*timestamp_type_, view.data(), view.size(), &value)) {
418 return Status::Invalid("couldn't parse timestamp from ", view);
419 }
420 } else {
421 return JSONTypeError("timestamp", json_obj.GetType());
422 }
423 return builder_->Append(value);
424 }
425
426 std::shared_ptr<ArrayBuilder> builder() override { return builder_; }
427

Callers

nothing calls this directly

Calls 10

ParseValueFunction · 0.85
JSONTypeErrorFunction · 0.85
InvalidFunction · 0.50
IsNullMethod · 0.45
AppendNullMethod · 0.45
GetStringMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
GetTypeMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected