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

Function MakeDeeplyNestedList

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

Source from the content-addressed store, hash-verified

558}
559
560Status MakeDeeplyNestedList(std::shared_ptr<RecordBatch>* out) {
561 const int batch_length = 5;
562 auto type = int32();
563
564 MemoryPool* pool = default_memory_pool();
565 std::shared_ptr<Array> array;
566 const bool include_nulls = true;
567 RETURN_NOT_OK(MakeRandomInt32Array(1000, include_nulls, pool, &array));
568 for (int i = 0; i < 63; ++i) {
569 type = std::static_pointer_cast<DataType>(list(type));
570 RETURN_NOT_OK(MakeRandomListArray(array, batch_length, include_nulls, pool, &array));
571 }
572
573 auto f0 = field("f0", type);
574 auto schema = ::arrow::schema({f0});
575 std::vector<std::shared_ptr<Array>> arrays = {array};
576 *out = RecordBatch::Make(schema, batch_length, arrays);
577 return Status::OK();
578}
579
580Status MakeDeeplyNestedListView(std::shared_ptr<RecordBatch>* out) {
581 const int batch_length = 5;

Callers 1

TEST_FFunction · 0.85

Calls 8

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

Tested by

no test coverage detected