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

Function TimedTestCastFloatFromString

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

Source from the content-addressed store, hash-verified

184}
185
186static 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
208static void TimedTestCastIntFromString(benchmark::State& state) {
209 auto field_a = field("a", utf8());

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