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

Function TimedTestInExpr

cpp/src/gandiva/tests/micro_benchmarks.cc:317–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317static void TimedTestInExpr(benchmark::State& state) {
318 // schema for input fields
319 auto fielda = field("a", utf8());
320 auto schema = arrow::schema({fielda});
321 auto pool_ = arrow::default_memory_pool();
322
323 // output fields
324 auto field_result = field("res", boolean());
325
326 // build expression.
327 // a in (string1, string2, ..)
328 auto node_a = TreeExprBuilder::MakeField(fielda);
329
330 std::unordered_set<std::string> values;
331 FastUtf8DataGenerator data_generator1(250);
332 for (int i = 1; i <= 32; i++) {
333 values.insert(data_generator1.GenerateData());
334 }
335 auto boolean_or = TreeExprBuilder::MakeInExpressionString(node_a, values);
336 auto expr = TreeExprBuilder::MakeExpression(boolean_or, field_result);
337
338 // Build a projector for the expressions.
339 std::shared_ptr<Projector> projector;
340 ASSERT_OK(Projector::Make(schema, {expr}, TestConfiguration(), &projector));
341
342 FastUtf8DataGenerator data_generator(250);
343 ProjectEvaluator evaluator(projector);
344
345 Status status = TimedEvaluate<arrow::StringType, std::string>(
346 schema, evaluator, data_generator, pool_, 100 * THOUSAND, 16 * THOUSAND, state);
347
348 ASSERT_OK(status);
349}
350
351static void DoDecimalAdd3(benchmark::State& state, int32_t precision, int32_t scale,
352 bool large = false) {

Callers

nothing calls this directly

Calls 7

default_memory_poolFunction · 0.85
TestConfigurationFunction · 0.85
fieldFunction · 0.50
schemaFunction · 0.50
MakeFunction · 0.50
insertMethod · 0.45
GenerateDataMethod · 0.45

Tested by

no test coverage detected