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

Function bits_to_indexes

cpp/src/arrow/compute/util.cc:136–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void bits_to_indexes(int bit_to_search, int64_t hardware_flags, int num_bits,
137 const uint8_t* bits, int* num_indexes, uint16_t* indexes,
138 int bit_offset) {
139 bits += bit_offset / 8;
140 bit_offset %= 8;
141 *num_indexes = 0;
142 uint16_t base_index = 0;
143 if (bit_offset != 0) {
144 uint64_t bits_head = bits[0] >> bit_offset;
145 int bits_in_first_byte = std::min(num_bits, 8 - bit_offset);
146 bits_to_indexes(bit_to_search, hardware_flags, bits_in_first_byte,
147 reinterpret_cast<const uint8_t*>(&bits_head), num_indexes, indexes);
148 if (num_bits <= bits_in_first_byte) {
149 return;
150 }
151 num_bits -= bits_in_first_byte;
152 indexes += *num_indexes;
153 bits += 1;
154 base_index = bits_in_first_byte;
155 }
156
157 int num_indexes_new = 0;
158 if (bit_to_search == 0) {
159 bits_to_indexes_internal<0, false>(hardware_flags, num_bits, bits, nullptr,
160 &num_indexes_new, indexes, base_index);
161 } else {
162 ARROW_DCHECK(bit_to_search == 1);
163 bits_to_indexes_internal<1, false>(hardware_flags, num_bits, bits, nullptr,
164 &num_indexes_new, indexes, base_index);
165 }
166 *num_indexes += num_indexes_new;
167}
168
169void bits_filter_indexes(int bit_to_search, int64_t hardware_flags, const int num_bits,
170 const uint8_t* bits, const uint16_t* input_indexes,

Callers 10

EqualCallbackMethod · 0.85
MapMethod · 0.85
CollectPassingBatchIdsFunction · 0.85
FilterRightSemiAntiMethod · 0.85
HashMultiColumnMethod · 0.85
run_comparisonsMethod · 0.85
findMethod · 0.85
bits_split_indexesFunction · 0.85
CompareColumnsToRowsMethod · 0.85
ConsumeImplMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected