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

Function GenerateBatchesFromString

cpp/src/arrow/acero/hash_join_node_test.cc:62–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60namespace acero {
61
62BatchesWithSchema GenerateBatchesFromString(
63 const std::shared_ptr<Schema>& schema,
64 const std::vector<std::string_view>& json_strings, int multiplicity = 1) {
65 BatchesWithSchema out_batches{{}, schema};
66
67 std::vector<TypeHolder> types;
68 for (auto&& field : schema->fields()) {
69 types.emplace_back(field->type());
70 }
71
72 for (auto&& s : json_strings) {
73 out_batches.batches.push_back(ExecBatchFromJSON(types, s));
74 }
75
76 size_t batch_count = out_batches.batches.size();
77 for (int repeat = 1; repeat < multiplicity; ++repeat) {
78 for (size_t i = 0; i < batch_count; ++i) {
79 out_batches.batches.push_back(out_batches.batches[i]);
80 }
81 }
82
83 return out_batches;
84}
85
86void CheckRunOutput(JoinType type, const BatchesWithSchema& l_batches,
87 const BatchesWithSchema& r_batches,

Callers 3

RunNonEmptyTestFunction · 0.85
RunEmptyTestFunction · 0.85
TESTFunction · 0.85

Calls 6

ExecBatchFromJSONFunction · 0.85
emplace_backMethod · 0.80
push_backMethod · 0.80
fieldsMethod · 0.45
typeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected