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

Method DecodedArraysToBatch

cpp/src/arrow/csv/reader.cc:512–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510 conversion_schema(std::move(conversion_schema)) {}
511
512 Result<std::shared_ptr<RecordBatch>> DecodedArraysToBatch(
513 std::vector<std::shared_ptr<Array>> arrays) {
514 const auto n_rows = arrays[0]->length();
515
516 if (schema == nullptr) {
517 FieldVector fields(arrays.size());
518 for (size_t i = 0; i < arrays.size(); ++i) {
519 fields[i] = field(conversion_schema.columns[i].name, arrays[i]->type());
520 }
521
522 if (n_rows == 0) {
523 // No rows so schema is not reliable. return RecordBatch but do not set schema
524 return RecordBatch::Make(arrow::schema(std::move(fields)), n_rows,
525 std::move(arrays));
526 }
527
528 schema = arrow::schema(std::move(fields));
529 }
530
531 return RecordBatch::Make(schema, n_rows, std::move(arrays));
532 }
533
534 // Make column decoders from conversion schema
535 Status MakeColumnDecoders(io::IOContext io_context) {

Callers

nothing calls this directly

Calls 6

fieldFunction · 0.50
MakeFunction · 0.50
schemaFunction · 0.50
lengthMethod · 0.45
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected