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

Function ValuesToBitmap

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

SetBitFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected