From 3c57779bd269455d3698cda3e75a1e916ed517cd Mon Sep 17 00:00:00 2001 From: emkornfield Date: Wed, 24 Jan 2024 21:52:50 -0800 Subject: [PATCH] update error message --- cpp/src/parquet/column_writer.cc | 8 ++++---- cpp/src/parquet/column_writer_test.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/src/parquet/column_writer.cc b/cpp/src/parquet/column_writer.cc index 19ae5afb68b77..23366b2daafd5 100644 --- a/cpp/src/parquet/column_writer.cc +++ b/cpp/src/parquet/column_writer.cc @@ -295,7 +295,7 @@ class SerializedPageWriter : public PageWriter { const uint8_t* output_data_buffer = compressed_data->data(); if (compressed_data->size() > std::numeric_limits::max()) { throw ParquetException( - "Compressed dictionary page size overflows to INT32_MAX. Size: ", + "Compressed dictionary page size overflows INT32_MAX. Size: ", uncompressed_size); } int32_t output_data_len = static_cast(compressed_data->size()); @@ -384,7 +384,7 @@ class SerializedPageWriter : public PageWriter { int64_t output_data_len = compressed_data->size(); if (output_data_len > std::numeric_limits::max()) { - throw ParquetException("Compressed data page size overflows to INT32_MAX. Size:", + throw ParquetException("Compressed data page size overflows INT32_MAX. Size:", output_data_len); } @@ -401,7 +401,7 @@ class SerializedPageWriter : public PageWriter { format::PageHeader page_header; if (uncompressed_size > std::numeric_limits::max()) { - throw ParquetException("Uncompressed data page size overflows to INT32_MAX. Size:", + throw ParquetException("Uncompressed data page size overflows INT32_MAX. Size:", uncompressed_size); } page_header.__set_uncompressed_page_size(static_cast(uncompressed_size)); @@ -442,7 +442,7 @@ class SerializedPageWriter : public PageWriter { if (offset_index_builder_ != nullptr) { const int64_t compressed_size = output_data_len + header_size; if (compressed_size > std::numeric_limits::max()) { - throw ParquetException("Compressed page size overflows to INT32_MAX."); + throw ParquetException("Compressed page size overflows INT32_MAX."); } if (!page.first_row_index().has_value()) { throw ParquetException("First row index is not set in data page."); diff --git a/cpp/src/parquet/column_writer_test.cc b/cpp/src/parquet/column_writer_test.cc index b5304f9768ba9..3b9f3ac6fe67a 100644 --- a/cpp/src/parquet/column_writer_test.cc +++ b/cpp/src/parquet/column_writer_test.cc @@ -919,7 +919,7 @@ TEST(TestPageWriter, ThrowsOnPagesTooLarge) { Encoding::BIT_PACKED, Encoding::BIT_PACKED, /*uncompressed_size=*/100); EXPECT_THAT([&]() { pager->WriteDataPage(over_compressed_limit); }, - ThrowsMessage(HasSubstr("overflows to INT32_MAX"))); + ThrowsMessage(HasSubstr("overflows INT32_MAX"))); DictionaryPage dictionary_over_compressed_limit(buffer, /*num_values=*/100, Encoding::PLAIN); EXPECT_THROW(pager->WriteDictionaryPage(dictionary_over_compressed_limit), @@ -931,7 +931,7 @@ TEST(TestPageWriter, ThrowsOnPagesTooLarge) { Encoding::BIT_PACKED, /*uncompressed_size=*/std::numeric_limits::max() + int64_t{1}); EXPECT_THAT([&]() { pager->WriteDataPage(over_compressed_limit); }, - ThrowsMessage(HasSubstr("overflows to INT32_MAX"))); + ThrowsMessage(HasSubstr("overflows INT32_MAX"))); } TEST(TestColumnWriter, RepeatedListsUpdateSpacedBug) {