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

Function MakeRandomBatches

cpp/src/arrow/acero/test_util_internal.cc:278–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278BatchesWithSchema MakeRandomBatches(const std::shared_ptr<Schema>& schema,
279 int num_batches, int batch_size, int64_t alignment,
280 MemoryPool* memory_pool) {
281 BatchesWithSchema out;
282
283 random::RandomArrayGenerator rng(42);
284 out.batches.resize(num_batches);
285
286 for (int i = 0; i < num_batches; ++i) {
287 out.batches[i] =
288 ExecBatch(*rng.BatchOf(schema->fields(), batch_size, alignment, memory_pool));
289 }
290
291 out.schema = schema;
292 return out;
293}
294
295Result<BatchesWithSchema> MakeIntegerBatches(
296 const std::vector<std::function<int64_t(int)>>& gens,

Callers 7

JoinBenchmarkMethod · 0.85
RowArrayDecodeBenchmarkFunction · 0.85
ProjectionOverheadFunction · 0.85
TESTFunction · 0.85
FilterOverheadIsolatedFunction · 0.85

Calls 4

resizeMethod · 0.80
BatchOfMethod · 0.80
ExecBatchFunction · 0.50
fieldsMethod · 0.45

Tested by

no test coverage detected