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

Method ByteStreamSplit

cpp/src/parquet/encoding_test.cc:957–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955 }
956
957 void ByteStreamSplit(int seed) {
958 if constexpr (!std::is_same_v<ParquetType, FloatType> &&
959 !std::is_same_v<ParquetType, DoubleType> &&
960 !std::is_same_v<ParquetType, Int32Type> &&
961 !std::is_same_v<ParquetType, Int64Type> &&
962 !std::is_same_v<ParquetType, FLBAType>) {
963 return;
964 }
965 auto values = GetValues(seed);
966 auto encoder = MakeTypedEncoder<ParquetType>(
967 Encoding::BYTE_STREAM_SPLIT, /*use_dictionary=*/false, column_descr());
968 auto decoder =
969 MakeTypedDecoder<ParquetType>(Encoding::BYTE_STREAM_SPLIT, column_descr());
970
971 ASSERT_NO_THROW(encoder->Put(*values));
972 auto buf = encoder->FlushValues();
973
974 int num_values = static_cast<int>(values->length() - values->null_count());
975 decoder->SetData(num_values, buf->data(), static_cast<int>(buf->size()));
976
977 BuilderType acc(arrow_type(), ::arrow::default_memory_pool());
978 ASSERT_EQ(num_values,
979 decoder->DecodeArrow(static_cast<int>(values->length()),
980 static_cast<int>(values->null_count()),
981 values->null_bitmap_data(), values->offset(), &acc));
982
983 std::shared_ptr<::arrow::Array> result;
984 ASSERT_OK(acc.Finish(&result));
985 ASSERT_OK(result->ValidateFull());
986 ASSERT_EQ(50, result->length());
987 ::arrow::AssertArraysEqual(*values, *result);
988 }
989
990 void Rle(int seed) {
991 if (!std::is_same<ParquetType, BooleanType>::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