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

Function MakeFloat3264BatchSized

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

Source from the content-addressed store, hash-verified

311}
312
313Status MakeFloat3264BatchSized(int length, std::shared_ptr<RecordBatch>* out,
314 uint32_t seed) {
315 // Make the schema
316 auto f0 = field("f0", float32());
317 auto f1 = field("f1", float64());
318 auto schema = ::arrow::schema({f0, f1});
319
320 // Example data
321 std::shared_ptr<Array> a0, a1;
322 MemoryPool* pool = default_memory_pool();
323 RETURN_NOT_OK(MakeRandomArray<FloatType>(length, false, pool, &a0, seed));
324 RETURN_NOT_OK(MakeRandomArray<DoubleType>(length, true, pool, &a1, seed + 1));
325 *out = RecordBatch::Make(schema, length, {a0, a1});
326 return Status::OK();
327}
328
329Status MakeFloat3264Batch(std::shared_ptr<RecordBatch>* out) {
330 return MakeFloat3264BatchSized(10, out);

Callers 2

MakeFloat3264BatchFunction · 0.85
TEST_PFunction · 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