Skip to content

Commit

Permalink
Add test inside ArrowBinaryDirectPut
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed May 6, 2024
1 parent f8849ea commit a9e6e71
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cpp/src/parquet/encoding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,11 @@ TEST(PlainEncodingAdHoc, ArrowBinaryDirectPut) {
auto decoder = MakeTypedDecoder<ByteArrayType>(Encoding::PLAIN);

ASSERT_NO_THROW(encoder->Put(*values));
// For Plain encoding, the estimated size should be at least the total byte size
auto& string_array = dynamic_cast<const ::arrow::StringArray&>(*values);
EXPECT_GE(encoder->EstimatedDataEncodedSize(), string_array.total_values_length())
<< "Estimated size should be at least the total byte size";

auto buf = encoder->FlushValues();

int num_values = static_cast<int>(values->length() - values->null_count());
Expand Down Expand Up @@ -2160,6 +2165,10 @@ TEST(DeltaLengthByteArrayEncodingAdHoc, ArrowBinaryDirectPut) {

auto CheckSeed = [&](std::shared_ptr<::arrow::Array> values) {
ASSERT_NO_THROW(encoder->Put(*values));
auto& string_array = checked_cast<const ::arrow::StringArray&>(*values);
// For DeltaLength encoding, the estimated size should be at least the total byte size
EXPECT_GE(encoder->EstimatedDataEncodedSize(), string_array.total_values_length())
<< "Estimated size should be at least the total byte size";
auto buf = encoder->FlushValues();

int num_values = static_cast<int>(values->length() - values->null_count());
Expand Down

0 comments on commit a9e6e71

Please sign in to comment.