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

Function MakeZeroLengthRecordBatch

cpp/src/arrow/ipc/test_common.cc:517–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517Status MakeZeroLengthRecordBatch(std::shared_ptr<RecordBatch>* out) {
518 // Make the schema
519 auto f0 = field("f0", list(int32()));
520 auto f1 = field("f1", list(list(int32())));
521 auto f2 = field("f2", int32());
522 auto schema = ::arrow::schema({f0, f1, f2});
523
524 // Example data
525 MemoryPool* pool = default_memory_pool();
526 const bool include_nulls = true;
527 std::shared_ptr<Array> leaf_values, list_array, list_list_array, flat_array;
528 RETURN_NOT_OK(MakeRandomInt32Array(0, include_nulls, pool, &leaf_values));
529 RETURN_NOT_OK(MakeRandomListArray(leaf_values, 0, include_nulls, pool, &list_array));
530 RETURN_NOT_OK(
531 MakeRandomListArray(list_array, 0, include_nulls, pool, &list_list_array));
532 RETURN_NOT_OK(MakeRandomInt32Array(0, include_nulls, pool, &flat_array));
533 *out = RecordBatch::Make(schema, 0, {list_array, list_list_array, flat_array});
534 return Status::OK();
535}
536
537Status MakeNonNullRecordBatch(std::shared_ptr<RecordBatch>* out) {
538 // Make the schema

Callers 1

TEST_FFunction · 0.85

Calls 8

listFunction · 0.85
default_memory_poolFunction · 0.85
MakeRandomInt32ArrayFunction · 0.85
MakeRandomListArrayFunction · 0.85
schemaFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected