Skip to content

Commit 14b8e3e

Browse files
committed
Fix failure on i386
1 parent bd7f5c0 commit 14b8e3e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cpp/src/parquet/encoding_test.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,7 @@ class TestByteStreamSplitEncoding : public TestEncodingBase<Type> {
12381238

12391239
encoder->PutSpaced(draws_, num_values_, valid_bits, valid_bits_offset);
12401240
encode_buffer_ = encoder->FlushValues();
1241-
ASSERT_EQ(encode_buffer_->size(),
1242-
static_cast<int>(sizeof(c_type)) * (num_values_ - null_count));
1241+
ASSERT_EQ(encode_buffer_->size(), physical_byte_width() * (num_values_ - null_count));
12431242
decoder->SetData(num_values_ - null_count, encode_buffer_->data(),
12441243
static_cast<int>(encode_buffer_->size()));
12451244
auto values_decoded = decoder->DecodeSpaced(decode_buf_, num_values_, null_count,
@@ -1302,6 +1301,11 @@ class TestByteStreamSplitEncoding : public TestEncodingBase<Type> {
13021301
ASSERT_EQ(expected_encoded_data[i], encoded_data_raw[i]);
13031302
}
13041303
}
1304+
1305+
int physical_byte_width() const {
1306+
return std::is_same_v<c_type, FLBA> ? descr_->type_length()
1307+
: static_cast<int>(sizeof(c_type));
1308+
}
13051309
};
13061310

13071311
template <typename c_type>

0 commit comments

Comments
 (0)