Skip to content

Commit

Permalink
Fix failure on i386
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Feb 19, 2024
1 parent 7a19483 commit df652bf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cpp/src/parquet/encoding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,7 @@ class TestByteStreamSplitEncoding : public TestEncodingBase<Type> {

encoder->PutSpaced(draws_, num_values_, valid_bits, valid_bits_offset);
encode_buffer_ = encoder->FlushValues();
ASSERT_EQ(encode_buffer_->size(),
static_cast<int>(sizeof(c_type)) * (num_values_ - null_count));
ASSERT_EQ(encode_buffer_->size(), physical_byte_width() * (num_values_ - null_count));
decoder->SetData(num_values_ - null_count, encode_buffer_->data(),
static_cast<int>(encode_buffer_->size()));
auto values_decoded = decoder->DecodeSpaced(decode_buf_, num_values_, null_count,
Expand Down Expand Up @@ -1302,6 +1301,11 @@ class TestByteStreamSplitEncoding : public TestEncodingBase<Type> {
ASSERT_EQ(expected_encoded_data[i], encoded_data_raw[i]);
}
}

int physical_byte_width() const {
return std::is_same_v<c_type, FLBA> ? descr_->type_length()
: static_cast<int>(sizeof(c_type));
}
};

template <typename c_type>
Expand Down

0 comments on commit df652bf

Please sign in to comment.