pitrou commented on code in PR #44043:
URL: https://github.com/apache/arrow/pull/44043#discussion_r1912930232
##########
cpp/src/parquet/file_writer.cc:
##########
@@ -359,14 +359,26 @@ class FileSerializer : public ParquetFileWriter::Contents
{
if (row_group_writer_) {
row_group_writer_->Close();
}
+ int16_t row_group_ordinal = 0;
+ if (num_row_groups_ < std::numeric_limits<int16_t>::max()) {
+ row_group_ordinal = static_cast<int16_t>(num_row_groups_);
+ } else if (file_encryptor_ == nullptr) {
+ // Unencrypted parquet can have more than 32767 row groups.
+ row_group_ordinal = -1;
+ } else {
+ // Parquet thrifts using int16 for row group ordinal, so we can't have
more than
+ // 32767 row groups in a file.
+ throw ParquetException(
+ "Too many row groups in the file when writing row group with
encryption.");
Review Comment:
I suggest a slightly more explicit message
```suggestion
throw ParquetException(
"Cannot write more than 32767 row groups in an encrypted file");
```
--
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]