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

Function MakeIntTestBatch

cpp/src/arrow/csv/writer_benchmark.cc:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44constexpr int kCsvCols = 10;
45
46std::shared_ptr<RecordBatch> MakeIntTestBatch(int rows, int cols, int64_t null_percent) {
47 random::RandomArrayGenerator rg(kSeed);
48
49 FieldVector fields(cols);
50 ArrayVector arrays(cols);
51 for (int i = 0; i < cols; ++i) {
52 fields[i] = field('i' + std::to_string(i), int32());
53 arrays[i] = rg.Int32(rows, -87654321, 123456789, null_percent / 100.);
54 }
55 return RecordBatch::Make(schema(fields), rows, arrays);
56}
57
58std::shared_ptr<RecordBatch> MakeStrTestBatch(int rows, int cols, bool quote,
59 int64_t null_percent) {

Callers 2

WriteCsvNumericFunction · 0.85

Calls 5

to_stringFunction · 0.85
Int32Method · 0.80
fieldFunction · 0.50
MakeFunction · 0.50
schemaFunction · 0.50

Tested by

no test coverage detected