| 110 | } |
| 111 | |
| 112 | static void TimedTestExtractYear(benchmark::State& state) { |
| 113 | // schema for input fields |
| 114 | auto field0 = field("f0", arrow::date64()); |
| 115 | auto schema = arrow::schema({field0}); |
| 116 | auto pool_ = arrow::default_memory_pool(); |
| 117 | |
| 118 | // output field |
| 119 | auto field_res = field("res", int64()); |
| 120 | |
| 121 | // Build expression |
| 122 | auto expr = TreeExprBuilder::MakeExpression("extractYear", {field0}, field_res); |
| 123 | |
| 124 | std::shared_ptr<Projector> projector; |
| 125 | ASSERT_OK(Projector::Make(schema, {expr}, TestConfiguration(), &projector)); |
| 126 | |
| 127 | Int64DataGenerator data_generator; |
| 128 | ProjectEvaluator evaluator(projector); |
| 129 | |
| 130 | Status status = TimedEvaluate<arrow::Date64Type, int64_t>( |
| 131 | schema, evaluator, data_generator, pool_, 1 * MILLION, 16 * THOUSAND, state); |
| 132 | ASSERT_TRUE(status.ok()); |
| 133 | } |
| 134 | |
| 135 | static void TimedTestFilterAdd2(benchmark::State& state) { |
| 136 | // schema for input fields |
nothing calls this directly
no test coverage detected