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

Method GetRleValues

be/src/util/rle-test.cc:44–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 /// Get many values from a batch RLE decoder using its low level functions.
43 template <typename T>
44 static bool GetRleValues(RleBatchDecoder<T>* decoder, int num_vals, T* vals) {
45 int decoded = 0;
46 // Decode repeated and literal runs until we've filled the output.
47 while (decoded < num_vals) {
48 if (decoder->NextNumRepeats() > 0) {
49 EXPECT_EQ(0, decoder->NextNumLiterals());
50 int num_repeats_to_output =
51 min<int>(decoder->NextNumRepeats(), num_vals - decoded);
52 T repeated_val = decoder->GetRepeatedValue(num_repeats_to_output);
53 for (int i = 0; i < num_repeats_to_output; ++i) {
54 *vals = repeated_val;
55 ++vals;
56 }
57 decoded += num_repeats_to_output;
58 continue;
59 }
60 int num_literals_to_output =
61 min<int>(decoder->NextNumLiterals(), num_vals - decoded);
62 if (num_literals_to_output == 0) return false;
63 if (!decoder->GetLiteralValues(num_literals_to_output, vals)) return false;
64 decoded += num_literals_to_output;
65 vals += num_literals_to_output;
66 }
67 return true;
68 }
69
70 /// Get many values from a batch RLE decoder using its low level functions.
71 template <typename T>

Callers

nothing calls this directly

Calls 4

NextNumRepeatsMethod · 0.80
NextNumLiteralsMethod · 0.80
GetLiteralValuesMethod · 0.80
GetRepeatedValueMethod · 0.45

Tested by

no test coverage detected