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

Method Convert

cpp/src/arrow/csv/converter.cc:568–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566 decoder_(type_, options_, static_cast<const TrieCache*>(trie_cache_.get())) {}
567
568 Result<std::shared_ptr<Array>> Convert(const BlockParser& parser,
569 int32_t col_index) override {
570 using BuilderType = typename TypeTraits<T>::BuilderType;
571 using value_type = typename ValueDecoderType::value_type;
572
573 BuilderType builder(type_, pool_);
574 RETURN_NOT_OK(PresizeBuilder(parser, &builder));
575
576 auto visit = [&](const uint8_t* data, uint32_t size, bool quoted) -> Status {
577 if (decoder_.IsNull(data, size, quoted /* quoted */)) {
578 return builder.AppendNull();
579 }
580 value_type value{};
581 RETURN_NOT_OK(decoder_.Decode(data, size, quoted, &value));
582 builder.UnsafeAppend(value);
583 return Status::OK();
584 };
585 RETURN_NOT_OK(parser.VisitColumn(col_index, visit));
586
587 std::shared_ptr<Array> res;
588 RETURN_NOT_OK(builder.Finish(&res));
589 return res;
590 }
591
592 protected:
593 Status Initialize() override { return decoder_.Initialize(); }

Callers

nothing calls this directly

Calls 7

PresizeBuilderFunction · 0.85
OKFunction · 0.50
IsNullMethod · 0.45
AppendNullMethod · 0.45
DecodeMethod · 0.45
UnsafeAppendMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected