| 176 | // `offset` is used when this is called on a chunk of a chunked array |
| 177 | template <typename Partitioner> |
| 178 | NullPartitionResult PartitionNullsOnly(uint64_t* indices_begin, uint64_t* indices_end, |
| 179 | const Array& values, int64_t offset, |
| 180 | NullPlacement null_placement) { |
| 181 | if (values.null_count() == 0) { |
| 182 | return NullPartitionResult::NoNulls(indices_begin, indices_end, null_placement); |
| 183 | } |
| 184 | Partitioner partitioner; |
| 185 | if (null_placement == NullPlacement::AtStart) { |
| 186 | auto nulls_end = partitioner( |
| 187 | indices_begin, indices_end, |
| 188 | [&values, &offset](uint64_t ind) { return values.IsNull(ind - offset); }); |
| 189 | return NullPartitionResult::NullsAtStart(indices_begin, indices_end, nulls_end); |
| 190 | } else { |
| 191 | auto nulls_begin = partitioner( |
| 192 | indices_begin, indices_end, |
| 193 | [&values, &offset](uint64_t ind) { return !values.IsNull(ind - offset); }); |
| 194 | return NullPartitionResult::NullsAtEnd(indices_begin, indices_end, nulls_begin); |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | // Move non-null null-like values to end of array. |
| 199 | // |
nothing calls this directly
no test coverage detected