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

Method GetBatchWithDictSpaced

cpp/src/arrow/util/rle_encoding_internal.h:1469–1490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467template <typename T>
1468template <typename V>
1469auto RleBitPackedDecoder<T>::GetBatchWithDictSpaced(
1470 const V* dictionary, int32_t dictionary_length, V* out, rle_size_t batch_size,
1471 rle_size_t null_count, const uint8_t* valid_bits,
1472 int64_t valid_bits_offset) -> rle_size_t {
1473 if (null_count == 0) {
1474 return GetBatchWithDict<V>(dictionary, dictionary_length, out, batch_size);
1475 }
1476 if (null_count == batch_size) {
1477 // All nulls, avoid instantiating DictionaryConverter as dictionary_length
1478 // could be 0.
1479 std::fill(out, out + batch_size, V{});
1480 return batch_size;
1481 }
1482 if (ARROW_PREDICT_FALSE(batch_size <= 0 || dictionary_length == 0)) {
1483 // Either empty batch or invalid dictionary
1484 return 0;
1485 }
1486
1487 internal::DictionaryConverter<V, value_type> converter{dictionary, dictionary_length};
1488
1489 return GetSpaced(converter, out, batch_size, valid_bits, valid_bits_offset, null_count);
1490}
1491
1492/*************************
1493 * RleBitPackedEncoder *

Callers 2

CheckRoundTripFunction · 0.80
DecodeSpacedMethod · 0.80

Calls

no outgoing calls

Tested by 1

CheckRoundTripFunction · 0.64