| 135 | } |
| 136 | |
| 137 | vector_size_t SortingWriter::outputBatchRows() { |
| 138 | vector_size_t estimatedMaxOutputRows = |
| 139 | std::numeric_limits<vector_size_t>::max(); |
| 140 | if (sortBuffer_->estimateOutputRowSize().has_value() && |
| 141 | sortBuffer_->estimateOutputRowSize().value() != 0) { |
| 142 | const uint64_t maxOutputRows = |
| 143 | maxOutputBytesConfig_ / sortBuffer_->estimateOutputRowSize().value(); |
| 144 | |
| 145 | if (UNLIKELY(maxOutputRows > std::numeric_limits<vector_size_t>::max())) { |
| 146 | return maxOutputRowsConfig_; |
| 147 | } |
| 148 | |
| 149 | estimatedMaxOutputRows = maxOutputRows; |
| 150 | } |
| 151 | return std::min(estimatedMaxOutputRows, maxOutputRowsConfig_); |
| 152 | } |
| 153 | |
| 154 | std::unique_ptr<memory::MemoryReclaimer> SortingWriter::MemoryReclaimer::create( |
| 155 | SortingWriter* writer) { |
nothing calls this directly
no test coverage detected