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

Function ValuesToBitmap

python/pyarrow/src/arrow/python/numpy_to_arrow.cc:93–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92template <int TYPE>
93inline int64_t ValuesToBitmap(PyArrayObject* arr, uint8_t* bitmap) {
94 typedef internal::npy_traits<TYPE> traits;
95 typedef typename traits::value_type T;
96
97 int64_t null_count = 0;
98
99 Ndarray1DIndexer<T> values(arr);
100 for (int i = 0; i < values.size(); ++i) {
101 if (traits::isnull(values[i])) {
102 ++null_count;
103 } else {
104 bit_util::SetBit(bitmap, i);
105 }
106 }
107
108 return null_count;
109}
110
111class NumPyNullsConverter {
112 public:

Callers

nothing calls this directly

Calls 2

SetBitFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected