| 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) { |
no test coverage detected