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

Function MakeNonNullRecordBatch

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

Source from the content-addressed store, hash-verified

535}
536
537Status MakeNonNullRecordBatch(std::shared_ptr<RecordBatch>* out) {
538 // Make the schema
539 auto f0 = field("f0", list(int32()));
540 auto f1 = field("f1", list(list(int32())));
541 auto f2 = field("f2", int32());
542 auto schema = ::arrow::schema({f0, f1, f2});
543
544 // Example data
545 MemoryPool* pool = default_memory_pool();
546 const int length = 50;
547 std::shared_ptr<Array> leaf_values, list_array, list_list_array, flat_array;
548
549 RETURN_NOT_OK(MakeRandomInt32Array(1000, true, pool, &leaf_values));
550 bool include_nulls = false;
551 RETURN_NOT_OK(
552 MakeRandomListArray(leaf_values, length, include_nulls, pool, &list_array));
553 RETURN_NOT_OK(
554 MakeRandomListArray(list_array, length, include_nulls, pool, &list_list_array));
555 RETURN_NOT_OK(MakeRandomInt32Array(length, include_nulls, pool, &flat_array));
556 *out = RecordBatch::Make(schema, length, {list_array, list_list_array, flat_array});
557 return Status::OK();
558}
559
560Status MakeDeeplyNestedList(std::shared_ptr<RecordBatch>* out) {
561 const int batch_length = 5;

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