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

Function MakeRecordBatch

cpp/src/arrow/ipc/read_write_benchmark.cc:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace arrow {
37
38std::shared_ptr<RecordBatch> MakeRecordBatch(int64_t total_size, int64_t num_fields) {
39 int64_t length = total_size / num_fields / sizeof(int64_t);
40 random::RandomArrayGenerator rand(0x4f32a908);
41 auto type = arrow::int64();
42
43 ArrayVector arrays;
44 std::vector<std::shared_ptr<Field>> fields;
45 for (int64_t i = 0; i < num_fields; ++i) {
46 std::stringstream ss;
47 ss << "f" << i;
48 fields.push_back(field(ss.str(), type));
49 arrays.push_back(rand.Int64(length, 0, 100, 0.1));
50 }
51
52 auto schema = std::make_shared<Schema>(fields);
53 return RecordBatch::Make(schema, length, arrays);
54}
55
56std::vector<int> GetIncludedFields(int64_t num_fields, int64_t is_partial_read) {
57 if (is_partial_read) {

Callers 4

WriteRecordBatchFunction · 0.70
ReadRecordBatchFunction · 0.70
ReadStreamFunction · 0.70
DecodeStreamFunction · 0.70

Calls 5

push_backMethod · 0.80
strMethod · 0.80
fieldFunction · 0.50
MakeFunction · 0.50
Int64Method · 0.45

Tested by

no test coverage detected