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

Method Convert

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

Source from the content-addressed store, hash-verified

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