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

Function TimedTestExtractYear

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

Source from the content-addressed store, hash-verified

110}
111
112static void TimedTestExtractYear(benchmark::State& state) {
113 // schema for input fields
114 auto field0 = field("f0", arrow::date64());
115 auto schema = arrow::schema({field0});
116 auto pool_ = arrow::default_memory_pool();
117
118 // output field
119 auto field_res = field("res", int64());
120
121 // Build expression
122 auto expr = TreeExprBuilder::MakeExpression("extractYear", {field0}, field_res);
123
124 std::shared_ptr<Projector> projector;
125 ASSERT_OK(Projector::Make(schema, {expr}, TestConfiguration(), &projector));
126
127 Int64DataGenerator data_generator;
128 ProjectEvaluator evaluator(projector);
129
130 Status status = TimedEvaluate<arrow::Date64Type, int64_t>(
131 schema, evaluator, data_generator, pool_, 1 * MILLION, 16 * THOUSAND, state);
132 ASSERT_TRUE(status.ok());
133}
134
135static void TimedTestFilterAdd2(benchmark::State& state) {
136 // schema for input fields

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected