pitrou commented on issue #50595: URL: https://github.com/apache/arrow/issues/50595#issuecomment-6439263522
@goel-skd Are you still working on this? Judging by https://github.com/apache/arrow/pull/52469, this would still be useful, for example to reduce: ```c++ template <template <typename...> class Checker, typename InType> Status CheckFloatToIntImpl(const ArraySpan& input, const ArraySpan& output) { switch (output.type->id()) { case Type::INT8: return CheckFloatToIntValues<Checker, InType, Int8Type>(input, output); case Type::INT16: return CheckFloatToIntValues<Checker, InType, Int16Type>(input, output); case Type::INT32: return CheckFloatToIntValues<Checker, InType, Int32Type>(input, output); case Type::INT64: return CheckFloatToIntValues<Checker, InType, Int64Type>(input, output); case Type::UINT8: return CheckFloatToIntValues<Checker, InType, UInt8Type>(input, output); case Type::UINT16: return CheckFloatToIntValues<Checker, InType, UInt16Type>(input, output); case Type::UINT32: return CheckFloatToIntValues<Checker, InType, UInt32Type>(input, output); case Type::UINT64: return CheckFloatToIntValues<Checker, InType, UInt64Type>(input, output); default: break; } DCHECK(false); return Status::OK(); } ``` into something like: ```c++ template <template <typename...> class Checker, typename InType> Status CheckFloatToIntImpl(const ArraySpan& input, const ArraySpan& output) { return VisitIntegerType(*output.type, [&]<typename OutType>(OutType*) { return CheckFloatToIntValues<Checker, InType, OutType>(input, output); }); } ``` Also cc @taepper -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
