| 1336 | template <typename T> |
| 1337 | template <typename V> |
| 1338 | auto RleBitPackedDecoder<T>::GetBatchWithDictSpaced( |
| 1339 | const V* dictionary, int32_t dictionary_length, V* out, rle_size_t batch_size, |
| 1340 | rle_size_t null_count, const uint8_t* valid_bits, |
| 1341 | int64_t valid_bits_offset) -> rle_size_t { |
| 1342 | if (null_count == 0) { |
| 1343 | return GetBatchWithDict<V>(dictionary, dictionary_length, out, batch_size); |
| 1344 | } |
| 1345 | if (null_count == batch_size) { |
| 1346 | // All nulls, avoid instantiating DictionaryConverter as dictionary_length |
| 1347 | // could be 0. |
| 1348 | std::fill(out, out + batch_size, V{}); |
| 1349 | return batch_size; |
| 1350 | } |
| 1351 | if (ARROW_PREDICT_FALSE(batch_size <= 0 || dictionary_length == 0)) { |
| 1352 | // Either empty batch or invalid dictionary |
| 1353 | return 0; |
| 1354 | } |
| 1355 | |
| 1356 | internal::DictionaryConverter<V, value_type> converter{dictionary, dictionary_length}; |
| 1357 | |
| 1358 | return GetSpaced(converter, out, batch_size, valid_bits, valid_bits_offset, null_count); |
| 1359 | } |
| 1360 | |
| 1361 | /************************* |
| 1362 | * RleBitPackedEncoder * |
no outgoing calls