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

Function MakeListViewRecordBatchSized

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

Source from the content-addressed store, hash-verified

463}
464
465Status MakeListViewRecordBatchSized(const int length, std::shared_ptr<RecordBatch>* out) {
466 // Make the schema
467 auto f0 = field("f0", list_view(int32()));
468 auto f1 = field("f1", list_view(list_view(int32())));
469 auto f2 = field("f2", large_list_view(int32()));
470 auto schema = ::arrow::schema({f0, f1, f2});
471
472 // Example data
473
474 MemoryPool* pool = default_memory_pool();
475 std::shared_ptr<Array> leaf_values, list_array, list_list_array, large_list_array;
476 const bool include_nulls = true;
477 RETURN_NOT_OK(MakeRandomInt32Array(1000, include_nulls, pool, &leaf_values));
478 RETURN_NOT_OK(
479 MakeRandomListViewArray(leaf_values, length, include_nulls, pool, &list_array));
480 RETURN_NOT_OK(
481 MakeRandomListViewArray(list_array, length, include_nulls, pool, &list_list_array));
482 RETURN_NOT_OK(MakeRandomLargeListViewArray(leaf_values, length, include_nulls, pool,
483 &large_list_array));
484 *out =
485 RecordBatch::Make(schema, length, {list_array, list_list_array, large_list_array});
486 return Status::OK();
487}
488
489Status MakeListViewRecordBatch(std::shared_ptr<RecordBatch>* out) {
490 return MakeListViewRecordBatchSized(200, out);

Callers 2

MakeListViewRecordBatchFunction · 0.85
TEST_PFunction · 0.85

Calls 10

list_viewFunction · 0.85
large_list_viewFunction · 0.85
default_memory_poolFunction · 0.85
MakeRandomInt32ArrayFunction · 0.85
MakeRandomListViewArrayFunction · 0.85
schemaFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected