| 160 | } |
| 161 | |
| 162 | static void TimedTestFilterLike(benchmark::State& state) { |
| 163 | // schema for input fields |
| 164 | auto fielda = field("a", utf8()); |
| 165 | auto schema = arrow::schema({fielda}); |
| 166 | auto pool_ = arrow::default_memory_pool(); |
| 167 | |
| 168 | // build expression. |
| 169 | auto node_a = TreeExprBuilder::MakeField(fielda); |
| 170 | auto pattern_node = TreeExprBuilder::MakeStringLiteral("%yellow%"); |
| 171 | auto like_yellow = |
| 172 | TreeExprBuilder::MakeFunction("like", {node_a, pattern_node}, arrow::boolean()); |
| 173 | auto condition = TreeExprBuilder::MakeCondition(like_yellow); |
| 174 | |
| 175 | std::shared_ptr<Filter> filter; |
| 176 | ASSERT_OK(Filter::Make(schema, condition, TestConfiguration(), &filter)); |
| 177 | |
| 178 | FastUtf8DataGenerator data_generator(32); |
| 179 | FilterEvaluator evaluator(filter); |
| 180 | |
| 181 | Status status = TimedEvaluate<arrow::StringType, std::string>( |
| 182 | schema, evaluator, data_generator, pool_, 1 * MILLION, 16 * THOUSAND, state); |
| 183 | ASSERT_TRUE(status.ok()); |
| 184 | } |
| 185 | |
| 186 | static void TimedTestCastFloatFromString(benchmark::State& state) { |
| 187 | auto field_a = field("a", utf8()); |
nothing calls this directly
no test coverage detected