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

Function ConvertNumericNullable

python/pyarrow/src/arrow/python/arrow_to_pandas.cc:1074–1089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1072
1073template <typename InType, typename OutType>
1074inline 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
1091template <typename InType, typename OutType>
1092inline void ConvertNumericNullableCast(const ChunkedArray& data, InType na_value,

Callers

nothing calls this directly

Calls 4

num_chunksMethod · 0.45
null_countMethod · 0.45
lengthMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected