| 99 | } |
| 100 | |
| 101 | std::unique_ptr<SizeStatistics> SizeStatistics::Make(const ColumnDescriptor* descr) { |
| 102 | auto size_stats = std::make_unique<SizeStatistics>(); |
| 103 | // If the max level is 0, the level histogram can be omitted because it contains |
| 104 | // only single level (a.k.a. 0) and its count is equivalent to `num_values` of the |
| 105 | // column chunk or data page. |
| 106 | if (descr->max_repetition_level() != 0) { |
| 107 | size_stats->repetition_level_histogram.resize(descr->max_repetition_level() + 1, 0); |
| 108 | } |
| 109 | if (descr->max_definition_level() != 0) { |
| 110 | size_stats->definition_level_histogram.resize(descr->max_definition_level() + 1, 0); |
| 111 | } |
| 112 | if (descr->physical_type() == Type::BYTE_ARRAY) { |
| 113 | size_stats->unencoded_byte_array_data_bytes = 0; |
| 114 | } |
| 115 | return size_stats; |
| 116 | } |
| 117 | |
| 118 | std::ostream& operator<<(std::ostream& os, const SizeStatistics& size_stats) { |
| 119 | constexpr std::string_view kComma = ", "; |
nothing calls this directly
no test coverage detected