| 523 | } |
| 524 | |
| 525 | void AddQuantileKernels(VectorFunction* func) { |
| 526 | VectorKernel base; |
| 527 | base.init = QuantileState::Init; |
| 528 | base.can_execute_chunkwise = false; |
| 529 | base.output_chunked = false; |
| 530 | |
| 531 | for (const auto& ty : NumericTypes()) { |
| 532 | base.signature = KernelSignature::Make({InputType(ty)}, OutputType(ResolveOutput)); |
| 533 | // output type is determined at runtime, set template argument to nulltype |
| 534 | base.exec = GenerateNumeric<QuantileExecutor, NullType>(*ty); |
| 535 | base.exec_chunked = GenerateNumeric<QuantileExecutorChunked, NullType>(*ty); |
| 536 | DCHECK_OK(func->AddKernel(base)); |
| 537 | } |
| 538 | for (auto type_id : DecimalTypeIds()) { |
| 539 | base.signature = KernelSignature::Make({type_id}, OutputType(ResolveOutput)); |
| 540 | base.exec = GenerateDecimal<QuantileExecutor, NullType>(type_id); |
| 541 | base.exec_chunked = GenerateDecimal<QuantileExecutorChunked, NullType>(type_id); |
| 542 | DCHECK_OK(func->AddKernel(base)); |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | const FunctionDoc quantile_doc{ |
| 547 | "Compute an array of quantiles of a numeric array or chunked array", |
no test coverage detected