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

Function MakeIntBatchSized

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

Source from the content-addressed store, hash-verified

280}
281
282Status MakeIntBatchSized(int length, std::shared_ptr<RecordBatch>* out, uint32_t seed) {
283 // Make the schema
284 auto f0 = field("f0", int8());
285 auto f1 = field("f1", uint8());
286 auto f2 = field("f2", int16());
287 auto f3 = field("f3", uint16());
288 auto f4 = field("f4", int32());
289 auto f5 = field("f5", uint32());
290 auto f6 = field("f6", int64());
291 auto f7 = field("f7", uint64());
292 auto schema = ::arrow::schema({f0, f1, f2, f3, f4, f5, f6, f7});
293
294 // Example data
295 std::shared_ptr<Array> a0, a1, a2, a3, a4, a5, a6, a7;
296 MemoryPool* pool = default_memory_pool();
297 RETURN_NOT_OK(MakeRandomArray<Int8Type>(length, false, pool, &a0, seed));
298 RETURN_NOT_OK(MakeRandomArray<UInt8Type>(length, true, pool, &a1, seed));
299 RETURN_NOT_OK(MakeRandomArray<Int16Type>(length, true, pool, &a2, seed));
300 RETURN_NOT_OK(MakeRandomArray<UInt16Type>(length, false, pool, &a3, seed));
301 RETURN_NOT_OK(MakeRandomArray<Int32Type>(length, false, pool, &a4, seed));
302 RETURN_NOT_OK(MakeRandomArray<UInt32Type>(length, true, pool, &a5, seed));
303 RETURN_NOT_OK(MakeRandomArray<Int64Type>(length, true, pool, &a6, seed));
304 RETURN_NOT_OK(MakeRandomArray<UInt64Type>(length, false, pool, &a7, seed));
305 *out = RecordBatch::Make(schema, length, {a0, a1, a2, a3, a4, a5, a6, a7});
306 return Status::OK();
307}
308
309Status MakeIntRecordBatch(std::shared_ptr<RecordBatch>* out) {
310 return MakeIntBatchSized(10, out);

Callers 5

ExampleIntBatchesFunction · 0.85
MakeIntRecordBatchFunction · 0.85
TEST_PFunction · 0.85
TEST_FFunction · 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