| 1083 | |
| 1084 | template <typename InType, typename OutType> |
| 1085 | inline void ConvertNumericNullable(const ChunkedArray& data, InType na_value, |
| 1086 | OutType* out_values) { |
| 1087 | for (int c = 0; c < data.num_chunks(); c++) { |
| 1088 | const auto& arr = *data.chunk(c); |
| 1089 | const InType* in_values = GetPrimitiveValues<InType>(arr); |
| 1090 | |
| 1091 | if (arr.null_count() > 0) { |
| 1092 | for (int64_t i = 0; i < arr.length(); ++i) { |
| 1093 | *out_values++ = arr.IsNull(i) ? na_value : in_values[i]; |
| 1094 | } |
| 1095 | } else { |
| 1096 | memcpy(out_values, in_values, sizeof(InType) * arr.length()); |
| 1097 | out_values += arr.length(); |
| 1098 | } |
| 1099 | } |
| 1100 | } |
| 1101 | |
| 1102 | template <typename InType, typename OutType> |
| 1103 | inline void ConvertNumericNullableCast(const ChunkedArray& data, InType na_value, |
nothing calls this directly
no test coverage detected