MCPcopy Create free account
hub / github.com/databendlabs/databend / vectorized

Method vectorized

src/query/expression/src/function/function_builder.rs:375–412  ·  view source on GitHub ↗
(self, eval: F)

Source from the content-addressed store, hash-verified

373 }
374
375 pub fn vectorized<F>(self, eval: F) -> B
376 where F: VectorizedFn0<O> + 'static {
377 let Self {
378 builder,
379 return_type,
380 calc_domain,
381 derive_stat,
382 } = self;
383 let mut builder = builder;
384 let calc_domain = calc_domain.expect("typed calc_domain must be specified");
385
386 let signature = FunctionSignature {
387 name: builder.name().to_string(),
388 args_type: Vec::new(),
389 return_type: return_type.clone(),
390 };
391
392 let calc_wrapper = TypedNullaryCalcDomain {
393 calc_domain,
394 return_type: return_type.clone(),
395 _marker: PhantomData,
396 };
397 let eval_wrapper = TypedNullaryFunction {
398 func: eval,
399 return_type,
400 _marker: PhantomData,
401 };
402
403 builder.collect(Function {
404 signature,
405 eval: FunctionEval::Scalar {
406 calc_domain: Box::new(calc_wrapper),
407 eval: Box::new(eval_wrapper),
408 derive_stat: derive_stat.map(|eval| Box::new(eval) as _),
409 },
410 });
411 builder
412 }
413}
414
415#[derive(Clone)]

Callers 15

registerFunction · 0.80
register_inet_atonFunction · 0.80
register_inet_ntoaFunction · 0.80
registerFunction · 0.80
registerFunction · 0.80
registerFunction · 0.80
register_array_aggrFunction · 0.80
registerFunction · 0.80
registerFunction · 0.80
registerFunction · 0.80

Calls 8

expectMethod · 0.80
finish_withMethod · 0.80
newFunction · 0.50
to_stringMethod · 0.45
nameMethod · 0.45
cloneMethod · 0.45
collectMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected