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

Function RegisterVectorFunction

cpp/src/arrow/compute/kernels/vector_replace.cc:824–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822
823template <template <class> class Functor, template <class> class ChunkedFunctor>
824void RegisterVectorFunction(FunctionRegistry* registry,
825 std::shared_ptr<VectorFunction> func) {
826 auto add_primitive_kernel = [&](detail::GetTypeId get_id) {
827 AddKernel(
828 get_id.id, Functor<FixedSizeBinaryType>::GetSignature(get_id),
829 GenerateTypeAgnosticPrimitive<Functor, ArrayKernelExec>(get_id),
830 GenerateTypeAgnosticPrimitive<ChunkedFunctor, VectorKernel::ChunkedExec>(get_id),
831 registry, func.get());
832 };
833 for (const auto& ty : NumericTypes()) {
834 add_primitive_kernel(ty);
835 }
836 for (const auto& ty : TemporalTypes()) {
837 add_primitive_kernel(ty);
838 }
839 for (const auto& ty : IntervalTypes()) {
840 add_primitive_kernel(ty);
841 }
842 add_primitive_kernel(null());
843 add_primitive_kernel(boolean());
844 add_primitive_kernel(float16());
845 AddKernel(Type::FIXED_SIZE_BINARY,
846 Functor<FixedSizeBinaryType>::GetSignature(Type::FIXED_SIZE_BINARY),
847 Functor<FixedSizeBinaryType>::Exec, ChunkedFunctor<FixedSizeBinaryType>::Exec,
848 registry, func.get());
849 AddKernel(Type::DECIMAL128,
850 Functor<FixedSizeBinaryType>::GetSignature(Type::DECIMAL128),
851 Functor<FixedSizeBinaryType>::Exec, ChunkedFunctor<FixedSizeBinaryType>::Exec,
852 registry, func.get());
853 AddKernel(Type::DECIMAL256,
854 Functor<FixedSizeBinaryType>::GetSignature(Type::DECIMAL256),
855 Functor<FixedSizeBinaryType>::Exec, ChunkedFunctor<FixedSizeBinaryType>::Exec,
856 registry, func.get());
857 for (const auto& ty : BaseBinaryTypes()) {
858 AddKernel(ty->id(), Functor<FixedSizeBinaryType>::GetSignature(ty->id()),
859 GenerateTypeAgnosticVarBinaryBase<Functor>(*ty),
860 GenerateTypeAgnosticVarBinaryBase<ChunkedFunctor>(*ty), registry,
861 func.get());
862 }
863 // TODO: list types
864 DCHECK_OK(registry->AddFunction(std::move(func)));
865
866 // TODO(ARROW-9431): "replace_with_indices"
867}
868
869} // namespace
870

Callers

nothing calls this directly

Calls 4

AddKernelFunction · 0.85
getMethod · 0.45
idMethod · 0.45
AddFunctionMethod · 0.45

Tested by

no test coverage detected