| 1439 | template <typename T> |
| 1440 | template <typename V> |
| 1441 | auto RleBitPackedDecoder<T>::GetBatchWithDict(const V* dictionary, |
| 1442 | int32_t dictionary_length, V* out, |
| 1443 | rle_size_t batch_size) -> rle_size_t { |
| 1444 | if (ARROW_PREDICT_FALSE(batch_size <= 0 || dictionary_length == 0)) { |
| 1445 | // Either empty batch or invalid dictionary |
| 1446 | return 0; |
| 1447 | } |
| 1448 | |
| 1449 | internal::DictionaryConverter<V, value_type> converter{dictionary, dictionary_length}; |
| 1450 | |
| 1451 | // Make lightweight BitRun class to reuse the spaced code path with no nulls. |
| 1452 | constexpr internal::UnreachableBitRunReader validity_reader{}; |
| 1453 | internal::AllSetBitRun validity_run = {batch_size}; |
| 1454 | |
| 1455 | return ProcessValues( |
| 1456 | [&](auto& decoder, rle_size_t run_batch_size) { |
| 1457 | const auto read = internal::RunGetSpaced( |
| 1458 | &converter, out, run_batch_size, /* null_count= */ 0, value_bit_width_, |
| 1459 | &validity_reader, &validity_run, &decoder); |
| 1460 | ARROW_DCHECK_EQ(read.null_read, 0); |
| 1461 | out += read.values_read; |
| 1462 | return read.values_read; |
| 1463 | }, |
| 1464 | batch_size); |
| 1465 | } |
| 1466 | |
| 1467 | template <typename T> |
| 1468 | template <typename V> |