| 259 | |
| 260 | template <typename T> |
| 261 | Status Visit(const T&) { |
| 262 | if constexpr (is_numeric(T::type_id)) { |
| 263 | using In = typename T::c_type; |
| 264 | auto in_values = ArraySpan(in_data).GetSpan<In>(1, in_data.length); |
| 265 | |
| 266 | if (in_data.null_count == 0) { |
| 267 | if constexpr (std::is_same_v<In, Out>) { |
| 268 | memcpy(out_values, in_values.data(), in_values.size_bytes()); |
| 269 | out_values += in_values.size(); |
| 270 | } else { |
| 271 | for (In in_value : in_values) { |
| 272 | *out_values++ = static_cast<Out>(in_value); |
| 273 | } |
| 274 | } |
| 275 | } else { |
| 276 | for (int64_t i = 0; i < in_data.length; ++i) { |
| 277 | if constexpr (T::type_id == Type::HALF_FLOAT && std::is_same_v<Out, uint16_t>) { |
| 278 | *out_values++ = in_data.IsNull(i) |
| 279 | ? std::numeric_limits<util::Float16>::quiet_NaN().bits() |
| 280 | : static_cast<Out>(in_values[i]); |
| 281 | } else { |
| 282 | *out_values++ = in_data.IsNull(i) ? static_cast<Out>(NAN) |
| 283 | : static_cast<Out>(in_values[i]); |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | return Status::OK(); |
| 288 | } |
| 289 | Unreachable(); |
| 290 | } |
| 291 | }; |
| 292 | |
| 293 | template <typename Out> |
nothing calls this directly
no test coverage detected