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

Method DeltaBitPack

cpp/src/parquet/encoding_test.cc:1018–1045  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016 }
1017
1018 void DeltaBitPack(int seed) {
1019 if (!std::is_same<ParquetType, Int32Type>::value &&
1020 !std::is_same<ParquetType, Int64Type>::value) {
1021 return;
1022 }
1023 auto values = GetValues(seed);
1024 auto encoder = MakeTypedEncoder<ParquetType>(
1025 Encoding::DELTA_BINARY_PACKED, /*use_dictionary=*/false, column_descr());
1026 auto decoder =
1027 MakeTypedDecoder<ParquetType>(Encoding::DELTA_BINARY_PACKED, column_descr());
1028
1029 ASSERT_NO_THROW(encoder->Put(*values));
1030 auto buf = encoder->FlushValues();
1031
1032 int num_values = static_cast<int>(values->length() - values->null_count());
1033 decoder->SetData(num_values, buf->data(), static_cast<int>(buf->size()));
1034
1035 BuilderType acc(arrow_type(), ::arrow::default_memory_pool());
1036 ASSERT_EQ(num_values,
1037 decoder->DecodeArrow(static_cast<int>(values->length()),
1038 static_cast<int>(values->null_count()),
1039 values->null_bitmap_data(), values->offset(), &acc));
1040
1041 std::shared_ptr<::arrow::Array> result;
1042 ASSERT_OK(acc.Finish(&result));
1043 ASSERT_EQ(50, result->length());
1044 ::arrow::AssertArraysEqual(*values, *result);
1045 }
1046
1047 void Dict(int seed) {
1048 if (std::is_same<ParquetType, BooleanType>::value) {

Callers 1

TYPED_TESTFunction · 0.80

Calls 13

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