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

Method GetBatchWithDict

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

Source from the content-addressed store, hash-verified

1439template <typename T>
1440template <typename V>
1441auto 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
1467template <typename T>
1468template <typename V>

Callers 2

CheckRoundTripFunction · 0.80
DecodeMethod · 0.80

Calls 1

RunGetSpacedFunction · 0.85

Tested by 1

CheckRoundTripFunction · 0.64