Skip to content

Commit 2d7689a

Browse files
committed
- Propagate num_elements Parquet-based to TypedValuesBuffer and BasicXorEncryptor.
- Now num_elements is an invariant / constant all along TypedValuesBuffer and BasicXorEncryptor (Yay!) - Fixed issue on iterator to account for prefix size on input buffers. - Many unittest fixes for interfaces updates for num_elements.
1 parent 44357ac commit 2d7689a

11 files changed

Lines changed: 221 additions & 198 deletions

src/processing/encryption_sequencer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ bool DataBatchEncryptionSequencer::DecodeAndEncrypt(tcb::span<const uint8_t> pla
181181

182182
// Parse value bytes into typed values buffer
183183
stage_start = std::chrono::steady_clock::now();
184-
auto typed_buffer = ReinterpretValueBytesAsTypedValuesBuffer(value_bytes, datatype_, datatype_length_, encoding_);
184+
auto typed_buffer = ReinterpretValueBytesAsTypedValuesBuffer(
185+
value_bytes, num_elements, datatype_, datatype_length_, encoding_);
185186
parse_value_bytes_into_typed_list_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(
186187
std::chrono::steady_clock::now() - stage_start).count();
187188

src/processing/encryption_sequencer_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ TEST(EncryptionSequencer, FixedLenByteArrayValidation) {
484484
EXPECT_TRUE(testValidationFailure(0, "FIXED_LEN_BYTE_ARRAY datatype_length must be positive"));
485485

486486
// Test valid case (should pass parameter validation)
487-
DataBatchEncryptionSequencer sequencer("test_column", Type::FIXED_LEN_BYTE_ARRAY, 16, CompressionCodec::UNCOMPRESSED, Encoding::PLAIN, {{"page_type", "DICTIONARY_PAGE"}, {"dict_page_num_values", "1"}}, CompressionCodec::UNCOMPRESSED, "test_key_123", "test_user", "{}", {});
487+
DataBatchEncryptionSequencer sequencer("test_column", Type::FIXED_LEN_BYTE_ARRAY, 16, CompressionCodec::UNCOMPRESSED, Encoding::PLAIN, {{"page_type", "DICTIONARY_PAGE"}, {"dict_page_num_values", "2"}}, CompressionCodec::UNCOMPRESSED, "test_key_123", "test_user", "{}", {});
488488
bool result = sequencer.DecodeAndEncrypt(FIXED_LEN_BYTE_ARRAY_DATA);
489489

490490
if (!result && sequencer.error_stage_ == "parameter_validation") {

src/processing/encryptors/basic_xor_encryptor.cpp

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ std::vector<uint8_t> BasicXorEncryptor::EncryptTypedElements(
196196
constexpr bool is_fixed = TypedBuffer::is_fixed_sized;
197197
constexpr size_t prefix_length = is_fixed ? kFixedHeaderLength : kVariableHeaderLength;
198198

199-
// const size_t num_elements = 500000; // +++++++++ input_buffer.GetNumElements();
199+
// GetNumElements is read from Parquet metadata and level bytes, not calculated from payload.
200200
const size_t num_elements = input_buffer.GetNumElements();
201201

202202
// If there are no elements, return an empty buffer with the header.
@@ -229,15 +229,11 @@ std::vector<uint8_t> BasicXorEncryptor::EncryptTypedElements(
229229
num_elements, prefix_length, RawBytesFixedSizedCodec{element_size}};
230230

231231
auto loop_start = std::chrono::steady_clock::now();
232+
232233
size_t output_index = 0;
234+
tcb::span<const uint8_t> raw_bytes;
233235

234-
// ++++++ Restore the while (auto rawbytes = input_buffer.ElementsIteratorNext()) {} form.
235-
while (true) {
236-
// auto t0 = std::chrono::steady_clock::now();
237-
tcb::span<const uint8_t> raw_bytes;
238-
if (!input_buffer.ElementsIteratorNext(raw_bytes)) break;
239-
// get_raw_element_ns += ElapsedNanosecondsSince(t0);
240-
236+
while (input_buffer.ElementsIteratorNext(raw_bytes)) {
241237
// auto t1 = std::chrono::steady_clock::now();
242238
auto write_span = output_buffer.GetWritableRawElement(output_index, raw_bytes.size());
243239
// get_writable_element_ns += ElapsedNanosecondsSince(t1);
@@ -262,15 +258,14 @@ std::vector<uint8_t> BasicXorEncryptor::EncryptTypedElements(
262258
num_elements, reserved_bytes_hint, true, prefix_length};
263259

264260
auto loop_start = std::chrono::steady_clock::now();
265-
size_t output_index = 0;
266261

267-
// ++++++ Restore the while (auto rawbytes = input_buffer.ElementsIteratorNext()) {} form.
268-
while (true) {
269-
// auto t0 = std::chrono::steady_clock::now();
270-
tcb::span<const uint8_t> raw_bytes;
271-
if (!input_buffer.ElementsIteratorNext(raw_bytes)) break;
272-
// get_raw_element_ns += ElapsedNanosecondsSince(t0);
262+
size_t output_index = 0;
263+
tcb::span<const uint8_t> raw_bytes;
273264

265+
// ++++++ REMOVE ALL EXTRA INSTRUMENTATION AND TIMING CODE.
266+
// - CAREFUL WITH NOT REMOVING CORRECT INLINED COMMENTS !!!!
267+
268+
while (input_buffer.ElementsIteratorNext(raw_bytes)) {
274269
// auto t1 = std::chrono::steady_clock::now();
275270
auto write_span = output_buffer.GetWritableRawElement(output_index, raw_bytes.size());
276271
// get_writable_element_ns += ElapsedNanosecondsSince(t1);
@@ -344,12 +339,11 @@ template <typename TypedBuffer>
344339
TypedBuffer BasicXorEncryptor::DecryptFixedSizedElementsIntoTypedBuffer(
345340
const TypedBufferRawBytesFixedSized& encrypted_buffer, TypedBuffer output_buffer) {
346341
size_t output_index = 0;
347-
tcb::span<const uint8_t> raw_bytes;
348-
for (auto raw_bytes : encrypted_buffer.raw_elements()) {
349-
// +++++++ new iterator not working?
350-
// +++++++ while (encrypted_buffer.ElementsIteratorNext(raw_bytes)) {
351-
auto write_span = output_buffer.GetWritableRawElement(output_index, raw_bytes.size());
352-
XorDecryptInto(raw_bytes, write_span);
342+
tcb::span<const uint8_t> element_bytes;
343+
size_t element_size = encrypted_buffer.GetElementSize();
344+
while (encrypted_buffer.ElementsIteratorNext(element_bytes)) {
345+
auto write_span = output_buffer.GetWritableRawElement(output_index, element_size);
346+
XorDecryptInto(element_bytes, write_span);
353347
output_index++;
354348
}
355349
return output_buffer;
@@ -366,7 +360,7 @@ TypedValuesBuffer BasicXorEncryptor::DecryptValueList(
366360

367361
// Create a fixed-sized byte buffer for reading the encrypted elements.
368362
TypedBufferRawBytesFixedSized encrypted_buffer{
369-
encrypted_bytes, kFixedHeaderLength, RawBytesFixedSizedCodec{header.element_size}};
363+
encrypted_bytes, num_elements, kFixedHeaderLength, RawBytesFixedSizedCodec{header.element_size}};
370364

371365
// Populate a typed buffer with the decrypted elements in the corresponding type.
372366
switch (datatype_) {
@@ -399,21 +393,18 @@ TypedValuesBuffer BasicXorEncryptor::DecryptValueList(
399393
// Decrypt variable-size elements
400394
else {
401395
// Create a variable-sized byte buffer for reading the encrypted elements.
402-
TypedBufferRawBytesVariableSized encrypted_buffer{ encrypted_bytes, kVariableHeaderLength};
396+
TypedBufferRawBytesVariableSized encrypted_buffer{ encrypted_bytes, num_elements, kVariableHeaderLength};
403397

404398
switch (datatype_) {
405399
// Create a BYTE-ARRAY typed buffer for storing the decrypted elements.
406400
case Type::BYTE_ARRAY: {
407401
auto reserved_bytes_hint = encrypted_buffer.GetRawBufferSize();
408402
TypedBufferRawBytesVariableSized output_buffer{num_elements, reserved_bytes_hint, true};
409-
410403
size_t output_index = 0;
411-
tcb::span<const uint8_t> element;
412-
for (auto element : encrypted_buffer.raw_elements()) {
413-
// +++++++ new iterator not working?
414-
// +++++++ while (encrypted_buffer.ElementsIteratorNext(element)) {
415-
auto write_span = output_buffer.GetWritableRawElement(output_index, element.size());
416-
XorDecryptInto(element, write_span);
404+
tcb::span<const uint8_t> element_bytes;
405+
while (encrypted_buffer.ElementsIteratorNext(element_bytes)) {
406+
auto write_span = output_buffer.GetWritableRawElement(output_index, element_bytes.size());
407+
XorDecryptInto(element_bytes, write_span);
417408
output_index++;
418409
}
419410
return output_buffer;

src/processing/encryptors/basic_xor_encryptor_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ TEST(BasicXorEncryptor, EncryptDecryptValueList_RoundTrip_INT32) {
7171
// re-wrap bytes as a read buffer to match production read path behavior.
7272
std::vector<uint8_t> input_buffer_bytes = input_buffer_write.FinalizeAndTakeBuffer();
7373
const auto input_span = tcb::span<const uint8_t>(input_buffer_bytes.data(), input_buffer_bytes.size());
74-
TypedBufferI32 input_buffer_read{input_span};
74+
TypedBufferI32 input_buffer_read{input_span, values.size()};
7575
TypedValuesBuffer typed_buffer = std::move(input_buffer_read);
7676

7777
std::vector<uint8_t> encrypted_blob = encryptor.EncryptValueList(typed_buffer);
@@ -99,7 +99,7 @@ TEST(BasicXorEncryptor, EncryptDecryptValueList_RoundTrip_DOUBLE) {
9999
// re-wrap bytes as a read buffer to match production read path behavior.
100100
std::vector<uint8_t> input_buffer_bytes = input_buffer_write.FinalizeAndTakeBuffer();
101101
const auto input_span = tcb::span<const uint8_t>(input_buffer_bytes.data(), input_buffer_bytes.size());
102-
TypedBufferDouble input_buffer_read{input_span};
102+
TypedBufferDouble input_buffer_read{input_span, values.size()};
103103
TypedValuesBuffer typed_buffer = std::move(input_buffer_read);
104104

105105
std::vector<uint8_t> encrypted_blob = encryptor.EncryptValueList(typed_buffer);
@@ -149,7 +149,7 @@ TEST(BasicXorEncryptor, EncryptDecryptValueList_RoundTrip_BYTE_ARRAY) {
149149
// re-wrap bytes as a read buffer to match production read path behavior.
150150
std::vector<uint8_t> input_buffer_bytes = input_buffer_write.FinalizeAndTakeBuffer();
151151
const auto input_span = tcb::span<const uint8_t>(input_buffer_bytes.data(), input_buffer_bytes.size());
152-
TypedBufferRawBytesVariableSized input_buffer_read{input_span};
152+
TypedBufferRawBytesVariableSized input_buffer_read{input_span, values.size()};
153153
TypedValuesBuffer typed_buffer = std::move(input_buffer_read);
154154

155155
std::vector<uint8_t> encrypted_blob = encryptor.EncryptValueList(typed_buffer);

src/processing/parquet_utils.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ std::vector<uint8_t> CompressAndJoin(
390390
// Public functions to build Parquet formatted value bytes into TypedValuesBuffer
391391
// -----------------------------------------------------------------------------
392392

393-
TypedValuesBuffer ReinterpretValueBytesAsTypedValuesBuffer(tcb::span<const uint8_t> value_bytes,
393+
TypedValuesBuffer ReinterpretValueBytesAsTypedValuesBuffer(
394+
tcb::span<const uint8_t> value_bytes,
395+
size_t num_elements,
394396
Type::type datatype,
395397
const std::optional<int>& datatype_length,
396398
Encoding::type encoding) {
@@ -414,24 +416,24 @@ TypedValuesBuffer ReinterpretValueBytesAsTypedValuesBuffer(tcb::span<const uint8
414416

415417
switch (datatype) {
416418
case Type::INT32:
417-
return TypedBufferI32{value_bytes};
419+
return TypedBufferI32{value_bytes, num_elements};
418420
case Type::INT64:
419-
return TypedBufferI64{value_bytes};
421+
return TypedBufferI64{value_bytes, num_elements};
420422
case Type::FLOAT:
421-
return TypedBufferFloat{value_bytes};
423+
return TypedBufferFloat{value_bytes, num_elements};
422424
case Type::DOUBLE:
423-
return TypedBufferDouble{value_bytes};
425+
return TypedBufferDouble{value_bytes, num_elements};
424426
case Type::INT96:
425-
return TypedBufferInt96{value_bytes};
427+
return TypedBufferInt96{value_bytes, num_elements};
426428
case Type::FIXED_LEN_BYTE_ARRAY: {
427429
if (!datatype_length.has_value() || datatype_length.value() <= 0) {
428430
throw InvalidInputException("FIXED_LEN_BYTE_ARRAY requires a positive datatype_length");
429431
}
430432
return TypedBufferRawBytesFixedSized{
431-
value_bytes, 0, RawBytesFixedSizedCodec{static_cast<size_t>(datatype_length.value())}};
433+
value_bytes, num_elements, 0, RawBytesFixedSizedCodec{static_cast<size_t>(datatype_length.value())}};
432434
}
433435
case Type::BYTE_ARRAY:
434-
return TypedBufferRawBytesVariableSized{value_bytes};
436+
return TypedBufferRawBytesVariableSized{value_bytes, num_elements};
435437
default:
436438
throw InvalidInputException(
437439
"Invalid datatype: " + std::string(to_string(datatype)));

src/processing/parquet_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ std::vector<uint8_t> CompressAndJoin(
113113
*/
114114
dbps::processing::TypedValuesBuffer ReinterpretValueBytesAsTypedValuesBuffer(
115115
tcb::span<const uint8_t> value_bytes,
116+
size_t num_elements,
116117
Type::type datatype,
117118
const std::optional<int>& datatype_length,
118119
Encoding::type encoding);

src/processing/parquet_utils_test.cpp

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ TEST(ParquetUtils, Reinterpret_INT32) {
657657
reinterpret_cast<const uint8_t*>(values.data()) + values.size() * sizeof(int32_t));
658658

659659
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
660-
bytes, Type::INT32, std::nullopt, Encoding::PLAIN);
660+
bytes, values.size(), Type::INT32, std::nullopt, Encoding::PLAIN);
661661

662662
auto* buf = std::get_if<TypedBufferI32>(&result);
663663
ASSERT_NE(nullptr, buf);
@@ -676,7 +676,7 @@ TEST(ParquetUtils, Reinterpret_DOUBLE) {
676676
reinterpret_cast<const uint8_t*>(values.data()) + values.size() * sizeof(double));
677677

678678
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
679-
bytes, Type::DOUBLE, std::nullopt, Encoding::PLAIN);
679+
bytes, values.size(), Type::DOUBLE, std::nullopt, Encoding::PLAIN);
680680

681681
auto* buf = std::get_if<TypedBufferDouble>(&result);
682682
ASSERT_NE(nullptr, buf);
@@ -704,7 +704,7 @@ TEST(ParquetUtils, Reinterpret_INT96) {
704704
}
705705

706706
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
707-
bytes, Type::INT96, std::nullopt, Encoding::PLAIN);
707+
bytes, expected.size(), Type::INT96, std::nullopt, Encoding::PLAIN);
708708

709709
auto* buf = std::get_if<TypedBufferInt96>(&result);
710710
ASSERT_NE(nullptr, buf);
@@ -736,7 +736,7 @@ TEST(ParquetUtils, Reinterpret_BYTE_ARRAY) {
736736
}
737737

738738
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
739-
bytes, Type::BYTE_ARRAY, std::nullopt, Encoding::PLAIN);
739+
bytes, expected.size(), Type::BYTE_ARRAY, std::nullopt, Encoding::PLAIN);
740740

741741
auto* buf = std::get_if<TypedBufferRawBytesVariableSized>(&result);
742742
ASSERT_NE(nullptr, buf);
@@ -764,7 +764,7 @@ TEST(ParquetUtils, Reinterpret_FIXED_LEN_BYTE_ARRAY) {
764764
}
765765

766766
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
767-
bytes, Type::FIXED_LEN_BYTE_ARRAY, element_len, Encoding::PLAIN);
767+
bytes, expected.size(), Type::FIXED_LEN_BYTE_ARRAY, element_len, Encoding::PLAIN);
768768

769769
auto* buf = std::get_if<TypedBufferRawBytesFixedSized>(&result);
770770
ASSERT_NE(nullptr, buf);
@@ -780,28 +780,28 @@ TEST(ParquetUtils, Reinterpret_FIXED_LEN_BYTE_ARRAY) {
780780
TEST(ParquetUtils, Reinterpret_UnsupportedEncoding) {
781781
std::vector<uint8_t> bytes = {0x01, 0x02, 0x03, 0x04};
782782
EXPECT_THROW(
783-
ReinterpretValueBytesAsTypedValuesBuffer(bytes, Type::INT32, std::nullopt, Encoding::RLE),
783+
ReinterpretValueBytesAsTypedValuesBuffer(bytes, 1u, Type::INT32, std::nullopt, Encoding::RLE),
784784
DBPSUnsupportedException);
785785
}
786786

787787
TEST(ParquetUtils, Reinterpret_RLE_DICTIONARY_Throws) {
788788
std::vector<uint8_t> bytes = {0x01, 0x02, 0x03, 0x04};
789789
EXPECT_THROW(
790-
ReinterpretValueBytesAsTypedValuesBuffer(bytes, Type::INT32, std::nullopt, Encoding::RLE_DICTIONARY),
790+
ReinterpretValueBytesAsTypedValuesBuffer(bytes, 1u, Type::INT32, std::nullopt, Encoding::RLE_DICTIONARY),
791791
DBPSUnsupportedException);
792792
}
793793

794794
TEST(ParquetUtils, Reinterpret_BOOLEAN_Throws) {
795795
std::vector<uint8_t> bytes = {0xB4};
796796
EXPECT_THROW(
797-
ReinterpretValueBytesAsTypedValuesBuffer(bytes, Type::BOOLEAN, std::nullopt, Encoding::PLAIN),
797+
ReinterpretValueBytesAsTypedValuesBuffer(bytes, 1u, Type::BOOLEAN, std::nullopt, Encoding::PLAIN),
798798
DBPSUnsupportedException);
799799
}
800800

801801
TEST(ParquetUtils, Reinterpret_InvalidDataSize) {
802802
std::vector<uint8_t> bytes = {0xAA, 0xBB, 0xCC};
803803
auto result = ReinterpretValueBytesAsTypedValuesBuffer(
804-
bytes, Type::INT32, std::nullopt, Encoding::PLAIN);
804+
bytes, 1u, Type::INT32, std::nullopt, Encoding::PLAIN);
805805

806806
auto* buf = std::get_if<TypedBufferI32>(&result);
807807
ASSERT_NE(nullptr, buf);
@@ -813,28 +813,29 @@ TEST(ParquetUtils, Reinterpret_InvalidDataSize) {
813813
TEST(ParquetUtils, Reinterpret_FIXED_LEN_BYTE_ARRAY_MissingLength_Throws) {
814814
std::vector<uint8_t> bytes = {0x01, 0x02, 0x03};
815815
EXPECT_THROW(
816-
ReinterpretValueBytesAsTypedValuesBuffer(bytes, Type::FIXED_LEN_BYTE_ARRAY, std::nullopt, Encoding::PLAIN),
816+
ReinterpretValueBytesAsTypedValuesBuffer(
817+
bytes, 1u, Type::FIXED_LEN_BYTE_ARRAY, std::nullopt, Encoding::PLAIN),
817818
InvalidInputException);
818819
}
819820

820821
TEST(ParquetUtils, Reinterpret_FIXED_LEN_BYTE_ARRAY_ZeroLength_Throws) {
821822
std::vector<uint8_t> bytes = {0x01, 0x02, 0x03};
822823
EXPECT_THROW(
823-
ReinterpretValueBytesAsTypedValuesBuffer(bytes, Type::FIXED_LEN_BYTE_ARRAY, 0, Encoding::PLAIN),
824+
ReinterpretValueBytesAsTypedValuesBuffer(bytes, 1u, Type::FIXED_LEN_BYTE_ARRAY, 0, Encoding::PLAIN),
824825
InvalidInputException);
825826
}
826827

827828
TEST(ParquetUtils, Reinterpret_FIXED_LEN_BYTE_ARRAY_NegativeLength_Throws) {
828829
std::vector<uint8_t> bytes = {0x01, 0x02, 0x03};
829830
EXPECT_THROW(
830-
ReinterpretValueBytesAsTypedValuesBuffer(bytes, Type::FIXED_LEN_BYTE_ARRAY, -1, Encoding::PLAIN),
831+
ReinterpretValueBytesAsTypedValuesBuffer(bytes, 1u, Type::FIXED_LEN_BYTE_ARRAY, -1, Encoding::PLAIN),
831832
InvalidInputException);
832833
}
833834

834835
TEST(ParquetUtils, Reinterpret_EmptyBytes_FixedSize) {
835836
std::vector<uint8_t> bytes;
836837
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
837-
bytes, Type::DOUBLE, std::nullopt, Encoding::PLAIN);
838+
bytes, 0u, Type::DOUBLE, std::nullopt, Encoding::PLAIN);
838839

839840
auto* buf = std::get_if<TypedBufferDouble>(&result);
840841
ASSERT_NE(nullptr, buf);
@@ -846,7 +847,7 @@ TEST(ParquetUtils, Reinterpret_EmptyBytes_FixedSize) {
846847
TEST(ParquetUtils, Reinterpret_EmptyBytes_VariableSize) {
847848
std::vector<uint8_t> bytes;
848849
TypedValuesBuffer result = ReinterpretValueBytesAsTypedValuesBuffer(
849-
bytes, Type::BYTE_ARRAY, std::nullopt, Encoding::PLAIN);
850+
bytes, 0u, Type::BYTE_ARRAY, std::nullopt, Encoding::PLAIN);
850851

851852
auto* buf = std::get_if<TypedBufferRawBytesVariableSized>(&result);
852853
ASSERT_NE(nullptr, buf);
@@ -866,7 +867,7 @@ TEST(ParquetUtils, RoundTrip_INT32) {
866867
reinterpret_cast<const uint8_t*>(values.data()) + values.size() * sizeof(int32_t));
867868

868869
auto read_buf = ReinterpretValueBytesAsTypedValuesBuffer(
869-
input_bytes, Type::INT32, std::nullopt, Encoding::PLAIN);
870+
input_bytes, values.size(), Type::INT32, std::nullopt, Encoding::PLAIN);
870871

871872
auto* src = std::get_if<TypedBufferI32>(&read_buf);
872873
ASSERT_NE(nullptr, src);
@@ -900,7 +901,7 @@ TEST(ParquetUtils, RoundTrip_BYTE_ARRAY) {
900901
}
901902

902903
auto read_buf = ReinterpretValueBytesAsTypedValuesBuffer(
903-
input_bytes, Type::BYTE_ARRAY, std::nullopt, Encoding::PLAIN);
904+
input_bytes, payloads.size(), Type::BYTE_ARRAY, std::nullopt, Encoding::PLAIN);
904905

905906
auto* src = std::get_if<TypedBufferRawBytesVariableSized>(&read_buf);
906907
ASSERT_NE(nullptr, src);
@@ -931,7 +932,7 @@ TEST(ParquetUtils, RoundTrip_FIXED_LEN_BYTE_ARRAY) {
931932
}
932933

933934
auto read_buf = ReinterpretValueBytesAsTypedValuesBuffer(
934-
input_bytes, Type::FIXED_LEN_BYTE_ARRAY, element_len, Encoding::PLAIN);
935+
input_bytes, payloads.size(), Type::FIXED_LEN_BYTE_ARRAY, element_len, Encoding::PLAIN);
935936

936937
auto* src = std::get_if<TypedBufferRawBytesFixedSized>(&read_buf);
937938
ASSERT_NE(nullptr, src);

0 commit comments

Comments
 (0)