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

Function MakeGroupableBatches

cpp/src/arrow/acero/plan_test.cc:1102–1131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1100namespace {
1101
1102BatchesWithSchema MakeGroupableBatches(int multiplicity = 1) {
1103 BatchesWithSchema out;
1104
1105 out.batches = {ExecBatchFromJSON({int32(), utf8()}, R"([
1106 [12, "alfa"],
1107 [7, "beta"],
1108 [3, "alfa"]
1109 ])"),
1110 ExecBatchFromJSON({int32(), utf8()}, R"([
1111 [-2, "alfa"],
1112 [-1, "gama"],
1113 [3, "alfa"]
1114 ])"),
1115 ExecBatchFromJSON({int32(), utf8()}, R"([
1116 [5, "gama"],
1117 [3, "beta"],
1118 [-8, "alfa"]
1119 ])")};
1120
1121 size_t batch_count = out.batches.size();
1122 for (int repeat = 1; repeat < multiplicity; ++repeat) {
1123 for (size_t i = 0; i < batch_count; ++i) {
1124 out.batches.push_back(out.batches[i]);
1125 }
1126 }
1127
1128 out.schema = schema({field("i32", int32()), field("str", utf8())});
1129
1130 return out;
1131}
1132
1133} // namespace
1134

Callers 1

TESTFunction · 0.70

Calls 5

ExecBatchFromJSONFunction · 0.85
push_backMethod · 0.80
schemaFunction · 0.50
fieldFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected