| 36 | using arrow::utf8; |
| 37 | |
| 38 | static void TimedTestAdd3(benchmark::State& state) { |
| 39 | // schema for input fields |
| 40 | auto field0 = field("f0", int64()); |
| 41 | auto field1 = field("f1", int64()); |
| 42 | auto field2 = field("f2", int64()); |
| 43 | auto schema = arrow::schema({field0, field1, field2}); |
| 44 | auto pool_ = arrow::default_memory_pool(); |
| 45 | |
| 46 | // output field |
| 47 | auto field_sum = field("add", int64()); |
| 48 | |
| 49 | // Build expression |
| 50 | auto part_sum = TreeExprBuilder::MakeFunction( |
| 51 | "add", {TreeExprBuilder::MakeField(field1), TreeExprBuilder::MakeField(field2)}, |
| 52 | int64()); |
| 53 | auto sum = TreeExprBuilder::MakeFunction( |
| 54 | "add", {TreeExprBuilder::MakeField(field0), part_sum}, int64()); |
| 55 | |
| 56 | auto sum_expr = TreeExprBuilder::MakeExpression(sum, field_sum); |
| 57 | |
| 58 | std::shared_ptr<Projector> projector; |
| 59 | ASSERT_OK(Projector::Make(schema, {sum_expr}, TestConfiguration(), &projector)); |
| 60 | |
| 61 | Int64DataGenerator data_generator; |
| 62 | ProjectEvaluator evaluator(projector); |
| 63 | |
| 64 | Status status = TimedEvaluate<arrow::Int64Type, int64_t>( |
| 65 | schema, evaluator, data_generator, pool_, 1 * MILLION, 16 * THOUSAND, state); |
| 66 | ASSERT_OK(status); |
| 67 | } |
| 68 | |
| 69 | static void TimedTestBigNested(benchmark::State& state) { |
| 70 | // schema for input fields |
nothing calls this directly
no test coverage detected