pitrou commented on code in PR #39528:
URL: https://github.com/apache/arrow/pull/39528#discussion_r1464699699
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -271,7 +271,12 @@ class SerializedPageWriter : public PageWriter {
}
int64_t WriteDictionaryPage(const DictionaryPage& page) override {
- int64_t uncompressed_size = page.size();
+ int64_t uncompressed_size = page.buffer()->size();
+ if (uncompressed_size > std::numeric_limits<int32_t>::max()) {
+ throw ParquetException(
+ "Uncompressed dictionary page size overflows to INT32_MAX. Size:",
Review Comment:
Grammar is weird here. Would this be better?
```suggestion
"Uncompressed dictionary page size overflows INT32_MAX. Size:",
```
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -288,6 +293,11 @@ class SerializedPageWriter : public PageWriter {
dict_page_header.__set_is_sorted(page.is_sorted());
const uint8_t* output_data_buffer = compressed_data->data();
+ if (compressed_data->size() > std::numeric_limits<int32_t>::max()) {
+ throw ParquetException(
Review Comment:
Same here and below.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]