| 184 | } |
| 185 | |
| 186 | static void TimedTestCastFloatFromString(benchmark::State& state) { |
| 187 | auto field_a = field("a", utf8()); |
| 188 | auto schema = arrow::schema({field_a}); |
| 189 | auto pool = arrow::default_memory_pool(); |
| 190 | |
| 191 | auto field_result = field("res", arrow::float64()); |
| 192 | |
| 193 | auto node_a = TreeExprBuilder::MakeField(field_a); |
| 194 | auto fn = TreeExprBuilder::MakeFunction("castFLOAT8", {node_a}, arrow::float64()); |
| 195 | auto expr = TreeExprBuilder::MakeExpression(fn, field_result); |
| 196 | |
| 197 | std::shared_ptr<Projector> projector; |
| 198 | ASSERT_OK(Projector::Make(schema, {expr}, TestConfiguration(), &projector)); |
| 199 | |
| 200 | Utf8FloatDataGenerator data_generator; |
| 201 | ProjectEvaluator evaluator(projector); |
| 202 | |
| 203 | Status status = TimedEvaluate<arrow::StringType, std::string>( |
| 204 | schema, evaluator, data_generator, pool, 1 * MILLION, 16 * THOUSAND, state); |
| 205 | ASSERT_TRUE(status.ok()); |
| 206 | } |
| 207 | |
| 208 | static void TimedTestCastIntFromString(benchmark::State& state) { |
| 209 | auto field_a = field("a", utf8()); |
nothing calls this directly
no test coverage detected