MCPcopy Create free account
hub / github.com/apache/impala / GetValues

Method GetValues

be/src/util/rle-encoding.h:744–774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

742
743template <typename T>
744inline int32_t RleBatchDecoder<T>::GetValues(int32_t num_values_to_consume, T* values) {
745 DCHECK_GT(num_values_to_consume, 0);
746 DCHECK(values != nullptr);
747
748 int32_t num_consumed = 0;
749 while (num_consumed < num_values_to_consume) {
750 // Add RLE encoded values by repeating the current value this number of times.
751 int32_t num_repeats = NextNumRepeats();
752 if (num_repeats > 0) {
753 int32_t num_repeats_to_set =
754 std::min(num_repeats, num_values_to_consume - num_consumed);
755 T repeated_value = GetRepeatedValue(num_repeats_to_set);
756 for (int i = 0; i < num_repeats_to_set; ++i) {
757 values[num_consumed + i] = repeated_value;
758 }
759 num_consumed += num_repeats_to_set;
760 continue;
761 }
762
763 // Add remaining literal values, if any.
764 int32_t num_literals = NextNumLiterals();
765 if (num_literals == 0) break;
766 int32_t num_literals_to_set =
767 std::min(num_literals, num_values_to_consume - num_consumed);
768 if (!GetLiteralValues(num_literals_to_set, values + num_consumed)) {
769 return 0;
770 }
771 num_consumed += num_literals_to_set;
772 }
773 return num_consumed;
774}
775
776template <typename T>
777inline int32_t RleBatchDecoder<T>::SkipValues(int32_t num_values) {

Callers 6

DecodeValueMethod · 0.80
FillCacheMethod · 0.80
RleBenchmarkFunction · 0.80
GetRleValuesBatchedMethod · 0.80
TEST_FFunction · 0.80

Calls 1

minFunction · 0.85

Tested by 3

GetRleValuesBatchedMethod · 0.64
TEST_FFunction · 0.64