| 535 | } |
| 536 | |
| 537 | Status 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 | |
| 560 | Status MakeDeeplyNestedList(std::shared_ptr<RecordBatch>* out) { |
| 561 | const int batch_length = 5; |
no test coverage detected