@@ -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) {
780780TEST (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
787787TEST (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
794794TEST (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
801801TEST (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) {
813813TEST (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
820821TEST (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
827828TEST (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
834835TEST (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) {
846847TEST (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