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

Function EncodeData

be/src/exec/parquet/parquet-bool-decoder-test.cc:27–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace impala {
26
27void EncodeData(const vector<bool>& data, parquet::Encoding::type encoding,
28 uint8_t* buffer, int buffer_len) {
29 if (encoding == parquet::Encoding::PLAIN) {
30 BitWriter writer(buffer, buffer_len);
31 for (int b : data) {
32 ASSERT_TRUE(writer.PutValue(b, 1));
33 }
34 writer.Flush();
35 } else {
36 DCHECK(encoding == parquet::Encoding::RLE);
37 // We need to pass 'buffer + 4' because the ParquetBoolDecoder ignores the first 4
38 // bytes (in Parquet RLE, the first 4 bytes are used to encode the data size).
39 RleEncoder encoder(buffer + 4, buffer_len - 4, 1);
40 for (int b : data) {
41 ASSERT_TRUE(encoder.Put(b));
42 }
43 encoder.Flush();
44 }
45}
46
47void TestSkipping(parquet::Encoding::type encoding, uint8_t* encoded_data,
48 int encoded_data_len, const vector<bool>& expected_data, int skip_at,

Callers 1

TESTFunction · 0.85

Calls 3

PutValueMethod · 0.45
FlushMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected