MCPcopy Create free account
hub / github.com/apache/arrow / TimedTestCastIntFromString

Function TimedTestCastIntFromString

cpp/src/gandiva/tests/micro_benchmarks.cc:208–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208static 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
230static void TimedTestAllocs(benchmark::State& state) {
231 // schema for input fields

Callers

nothing calls this directly

Calls 7

default_memory_poolFunction · 0.85
TestConfigurationFunction · 0.85
fieldFunction · 0.50
schemaFunction · 0.50
MakeFunctionFunction · 0.50
MakeFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected