| 284 | } |
| 285 | |
| 286 | void StreamWriter::EndRow() { |
| 287 | if (!file_writer_) { |
| 288 | throw ParquetException("StreamWriter not initialized"); |
| 289 | } |
| 290 | if (static_cast<std::size_t>(column_index_) < nodes_.size()) { |
| 291 | throw ParquetException("Cannot end row with " + std::to_string(column_index_) + |
| 292 | " of " + std::to_string(nodes_.size()) + " columns written"); |
| 293 | } |
| 294 | column_index_ = 0; |
| 295 | ++current_row_; |
| 296 | |
| 297 | if (max_row_group_size_ > 0) { |
| 298 | if (row_group_size_ > max_row_group_size_) { |
| 299 | EndRowGroup(); |
| 300 | } |
| 301 | // Initialize for each row with size already written |
| 302 | // (compressed + uncompressed). |
| 303 | row_group_size_ = row_group_writer_->total_bytes_written() + |
| 304 | row_group_writer_->total_compressed_bytes(); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | void StreamWriter::EndRowGroup() { |
| 309 | if (!file_writer_) { |
no test coverage detected