etseidl commented on code in PR #45285:
URL: https://github.com/apache/arrow/pull/45285#discussion_r1919585899
##########
cpp/src/parquet/size_statistics.cc:
##########
@@ -64,14 +64,23 @@ void
SizeStatistics::IncrementUnencodedByteArrayDataBytes(int64_t value) {
}
void SizeStatistics::Validate(const ColumnDescriptor* descr) const {
- if (repetition_level_histogram.size() !=
- static_cast<size_t>(descr->max_repetition_level() + 1)) {
- throw ParquetException("Repetition level histogram size mismatch");
- }
- if (definition_level_histogram.size() !=
- static_cast<size_t>(descr->max_definition_level() + 1)) {
- throw ParquetException("Definition level histogram size mismatch");
- }
+ auto validate_histogram = [](const std::vector<int64_t>& histogram, int16_t
max_level,
+ const std::string& name) {
+ if (histogram.empty()) {
+ // A levels histogram is always allowed to be missing.
Review Comment:
Should we also allow for missing `unencoded_byte_array_data_bytes` below?
Maybe a different PR.
--
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]