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

Method GetBatchWithDictSpaced

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

Source from the content-addressed store, hash-verified

1336template <typename T>
1337template <typename V>
1338auto 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 *

Callers 2

CheckRoundTripFunction · 0.80
DecodeSpacedMethod · 0.80

Calls

no outgoing calls

Tested by 1

CheckRoundTripFunction · 0.64