| 315 | } |
| 316 | |
| 317 | static 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 | |
| 351 | static void DoDecimalAdd3(benchmark::State& state, int32_t precision, int32_t scale, |
| 352 | bool large = false) { |
nothing calls this directly
no test coverage detected