| 1072 | |
| 1073 | template <typename InType, typename OutType> |
| 1074 | inline void ConvertNumericNullable(const ChunkedArray& data, InType na_value, |
| 1075 | OutType* out_values) { |
| 1076 | for (int c = 0; c < data.num_chunks(); c++) { |
| 1077 | const auto& arr = *data.chunk(c); |
| 1078 | const InType* in_values = GetPrimitiveValues<InType>(arr); |
| 1079 | |
| 1080 | if (arr.null_count() > 0) { |
| 1081 | for (int64_t i = 0; i < arr.length(); ++i) { |
| 1082 | *out_values++ = arr.IsNull(i) ? na_value : in_values[i]; |
| 1083 | } |
| 1084 | } else { |
| 1085 | memcpy(out_values, in_values, sizeof(InType) * arr.length()); |
| 1086 | out_values += arr.length(); |
| 1087 | } |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | template <typename InType, typename OutType> |
| 1092 | inline void ConvertNumericNullableCast(const ChunkedArray& data, InType na_value, |
nothing calls this directly
no test coverage detected