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

Method Converter_Struct

r/src/array_to_vector.cpp:742–754  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

740class Converter_Struct : public Converter {
741 public:
742 explicit Converter_Struct(const std::shared_ptr<ChunkedArray>& chunked_array)
743 : Converter(chunked_array), converters() {
744 const auto& struct_type =
745 checked_cast<const arrow::StructType&>(*chunked_array->type());
746
747 int nf = struct_type.num_fields();
748
749 std::shared_ptr<arrow::Table> array_as_table =
750 ValueOrStop(arrow::Table::FromChunkedStructArray(chunked_array));
751 for (int i = 0; i < nf; i++) {
752 converters.push_back(Converter::Make(array_as_table->column(i)));
753 }
754 }
755
756 SEXP Allocate(R_xlen_t n) const {
757 // allocate a data frame column to host each array

Callers

nothing calls this directly

Calls 6

ValueOrStopFunction · 0.85
push_backMethod · 0.80
MakeFunction · 0.50
typeMethod · 0.45
num_fieldsMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected