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

Function AddCommonNumberCasts

cpp/src/arrow/compute/kernels/scalar_cast_numeric.cc:773–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

771
772template <typename OutType>
773void AddCommonNumberCasts(const std::shared_ptr<DataType>& out_ty, CastFunction* func) {
774 AddCommonCasts(out_ty->id(), out_ty, func);
775
776 // Cast from boolean to number
777 DCHECK_OK(func->AddKernel(Type::BOOL, {boolean()}, out_ty,
778 CastFunctor<OutType, BooleanType>::Exec));
779
780 // Cast from other strings
781 for (const std::shared_ptr<DataType>& in_ty : BaseBinaryTypes()) {
782 auto exec = GenerateVarBinaryBase<CastFunctor, OutType>(*in_ty);
783 DCHECK_OK(func->AddKernel(in_ty->id(), {in_ty}, out_ty, exec));
784 }
785 for (const std::shared_ptr<DataType>& in_ty : BinaryViewTypes()) {
786 auto exec = GenerateVarBinaryViewBase<CastFunctor, OutType>(*in_ty);
787 DCHECK_OK(func->AddKernel(in_ty->id(), {in_ty}, out_ty, exec));
788 }
789}
790
791template <typename OutType>
792std::shared_ptr<CastFunction> GetCastToInteger(std::string name) {

Callers

nothing calls this directly

Calls 3

AddCommonCastsFunction · 0.85
idMethod · 0.45
AddKernelMethod · 0.45

Tested by

no test coverage detected