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

Function ConvertNumericNullable

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

Source from the content-addressed store, hash-verified

1083
1084template <typename InType, typename OutType>
1085inline 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
1102template <typename InType, typename OutType>
1103inline 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