| 43 | } |
| 44 | |
| 45 | Status TupleTextFileWriter::Write(RowBatch* row_batch) { |
| 46 | FOREACH_ROW(row_batch, 0, build_batch_iter) { |
| 47 | TupleRow* build_row = build_batch_iter.Get(); |
| 48 | DCHECK(build_row != nullptr); |
| 49 | // Convert to the human-readable representation of the row. |
| 50 | std::string row_str = PrintRow(build_row, *(row_batch->row_desc())) + '\n'; |
| 51 | writer_ << row_str; |
| 52 | bytes_written_ += row_str.size(); |
| 53 | } |
| 54 | return Status::OK(); |
| 55 | } |
| 56 | |
| 57 | void TupleTextFileWriter::Delete() { |
| 58 | if (writer_.is_open()) writer_.close(); |