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

Function MakeFloatBatchSized

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

Source from the content-addressed store, hash-verified

331}
332
333Status MakeFloatBatchSized(int length, std::shared_ptr<RecordBatch>* out, uint32_t seed) {
334 // Make the schema
335 auto f0 = field("f0", float16());
336 auto f1 = field("f1", float32());
337 auto f2 = field("f2", float64());
338 auto schema = ::arrow::schema({f0, f1, f2});
339
340 // Example data
341 std::shared_ptr<Array> a0, a1, a2;
342 MemoryPool* pool = default_memory_pool();
343 RETURN_NOT_OK(MakeRandomArray<HalfFloatType>(length, false, pool, &a0, seed));
344 RETURN_NOT_OK(MakeRandomArray<FloatType>(length, false, pool, &a1, seed + 1));
345 RETURN_NOT_OK(MakeRandomArray<DoubleType>(length, true, pool, &a2, seed + 2));
346 *out = RecordBatch::Make(schema, length, {a0, a1, a2});
347 return Status::OK();
348}
349
350Status MakeFloatBatch(std::shared_ptr<RecordBatch>* out) {
351 return MakeFloatBatchSized(10, out);

Callers 2

ExampleFloatBatchesFunction · 0.85
MakeFloatBatchFunction · 0.85

Calls 5

default_memory_poolFunction · 0.85
schemaFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected