Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed May 7, 2024
1 parent 006b769 commit 6198cbe
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions cpp/src/parquet/encoding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2165,19 +2165,9 @@ TEST(DeltaLengthByteArrayEncodingAdHoc, ArrowBinaryDirectPut) {

auto CheckSeed = [&](std::shared_ptr<::arrow::Array> values) {
ASSERT_NO_THROW(encoder->Put(*values));
int64_t expected_array_size = 0;
if (auto* string_array = dynamic_cast<const ::arrow::StringArray*>(values.get());
string_array != nullptr) {
expected_array_size = string_array->total_values_length();
} else if (auto* binary_array =
dynamic_cast<const ::arrow::BinaryArray*>(values.get());
binary_array != nullptr) {
expected_array_size = binary_array->total_values_length();
} else {
FAIL() << "Unexpected array type";
}
auto* binary_array = checked_cast<const ::arrow::BinaryArray*>(values.get());
// For DeltaLength encoding, the estimated size should be at least the total byte size
EXPECT_GE(encoder->EstimatedDataEncodedSize(), expected_array_size)
EXPECT_GE(encoder->EstimatedDataEncodedSize(), binary_array->total_values_length())
<< "Estimated size should be at least the total byte size";
auto buf = encoder->FlushValues();

Expand Down

0 comments on commit 6198cbe

Please sign in to comment.