| 42 | } // namespace |
| 43 | |
| 44 | void SizeStatistics::Merge(const SizeStatistics& other) { |
| 45 | if (repetition_level_histogram.size() != other.repetition_level_histogram.size()) { |
| 46 | throw ParquetException("Repetition level histogram size mismatch"); |
| 47 | } |
| 48 | if (definition_level_histogram.size() != other.definition_level_histogram.size()) { |
| 49 | throw ParquetException("Definition level histogram size mismatch"); |
| 50 | } |
| 51 | if (unencoded_byte_array_data_bytes.has_value() != |
| 52 | other.unencoded_byte_array_data_bytes.has_value()) { |
| 53 | throw ParquetException("Unencoded byte array data bytes are not consistent"); |
| 54 | } |
| 55 | MergeLevelHistogram(repetition_level_histogram, other.repetition_level_histogram); |
| 56 | MergeLevelHistogram(definition_level_histogram, other.definition_level_histogram); |
| 57 | if (unencoded_byte_array_data_bytes.has_value()) { |
| 58 | unencoded_byte_array_data_bytes = unencoded_byte_array_data_bytes.value() + |
| 59 | other.unencoded_byte_array_data_bytes.value(); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | void SizeStatistics::IncrementUnencodedByteArrayDataBytes(int64_t value) { |
| 64 | ARROW_CHECK(unencoded_byte_array_data_bytes.has_value()); |