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

Method Rle

cpp/src/parquet/encoding_test.cc:990–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

988 }
989
990 void Rle(int seed) {
991 if (!std::is_same<ParquetType, BooleanType>::value) {
992 return;
993 }
994 auto values = GetValues(seed);
995 auto encoder = MakeTypedEncoder<ParquetType>(Encoding::RLE, /*use_dictionary=*/false,
996 column_descr());
997 auto decoder = MakeTypedDecoder<ParquetType>(Encoding::RLE, column_descr());
998
999 ASSERT_NO_THROW(encoder->Put(*values));
1000 auto buf = encoder->FlushValues();
1001
1002 int num_values = static_cast<int>(values->length() - values->null_count());
1003 decoder->SetData(num_values, buf->data(), static_cast<int>(buf->size()));
1004
1005 BuilderType acc(arrow_type(), ::arrow::default_memory_pool());
1006 ASSERT_EQ(num_values,
1007 decoder->DecodeArrow(static_cast<int>(values->length()),
1008 static_cast<int>(values->null_count()),
1009 values->null_bitmap_data(), values->offset(), &acc));
1010
1011 std::shared_ptr<::arrow::Array> result;
1012 ASSERT_OK(acc.Finish(&result));
1013 ASSERT_OK(result->ValidateFull());
1014 ASSERT_EQ(50, result->length());
1015 ::arrow::AssertArraysEqual(*values, *result);
1016 }
1017
1018 void DeltaBitPack(int seed) {
1019 if (!std::is_same<ParquetType, Int32Type>::value &&

Callers 1

TYPED_TESTFunction · 0.80

Calls 14

GetValuesFunction · 0.85
default_memory_poolFunction · 0.85
AssertArraysEqualFunction · 0.85
PutMethod · 0.45
FlushValuesMethod · 0.45
lengthMethod · 0.45
null_countMethod · 0.45
SetDataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
DecodeArrowMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected