| 206 | } |
| 207 | |
| 208 | static void TimedTestCastIntFromString(benchmark::State& state) { |
| 209 | auto field_a = field("a", utf8()); |
| 210 | auto schema = arrow::schema({field_a}); |
| 211 | auto pool = arrow::default_memory_pool(); |
| 212 | |
| 213 | auto field_result = field("res", int32()); |
| 214 | |
| 215 | auto node_a = TreeExprBuilder::MakeField(field_a); |
| 216 | auto fn = TreeExprBuilder::MakeFunction("castINT", {node_a}, int32()); |
| 217 | auto expr = TreeExprBuilder::MakeExpression(fn, field_result); |
| 218 | |
| 219 | std::shared_ptr<Projector> projector; |
| 220 | ASSERT_OK(Projector::Make(schema, {expr}, TestConfiguration(), &projector)); |
| 221 | |
| 222 | Utf8IntDataGenerator data_generator; |
| 223 | ProjectEvaluator evaluator(projector); |
| 224 | |
| 225 | Status status = TimedEvaluate<arrow::StringType, std::string>( |
| 226 | schema, evaluator, data_generator, pool, 1 * MILLION, 16 * THOUSAND, state); |
| 227 | ASSERT_TRUE(status.ok()); |
| 228 | } |
| 229 | |
| 230 | static void TimedTestAllocs(benchmark::State& state) { |
| 231 | // schema for input fields |
nothing calls this directly
no test coverage detected