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

Function GenerateTestData

cpp/src/arrow/json/parser_benchmark.cc:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35template <typename Input>
36std::string GenerateTestData(const Input& input, int num_rows,
37 const GenerateOptions& options, bool pretty = false) {
38 std::default_random_engine engine(kSeed);
39 std::string json;
40 for (int i = 0; i < num_rows; ++i) {
41 Writer writer;
42 ABORT_NOT_OK(Generate(input, engine, &writer, options));
43
44 auto json_result = writer.GetString();
45 ABORT_NOT_OK(json_result.status());
46 auto json_view = std::move(json_result).ValueOrDie();
47
48 json += pretty ? PrettyPrint(json_view) : json_view;
49 json += "\n";
50 }
51 return json;
52}
53
54template <typename Input>
55std::string GenerateTestData(const Input& input, int num_rows, bool pretty = false) {

Callers 7

ChunkJSONPrettyPrintedFunction · 0.70
ChunkJSONLineDelimitedFunction · 0.70
ParseJSONBlockWithSchemaFunction · 0.70
ParseJSONFieldsFunction · 0.70
TYPED_TESTFunction · 0.50

Calls 6

GenerateFunction · 0.85
ValueOrDieMethod · 0.80
PrettyPrintFunction · 0.70
DefaultsFunction · 0.50
GetStringMethod · 0.45
statusMethod · 0.45

Tested by 1

TYPED_TESTFunction · 0.40