| 553 | |
| 554 | |
| 555 | void ArrowWriter::done(PointTableRef table) |
| 556 | { |
| 557 | // flush our final batch |
| 558 | flushBatch(); |
| 559 | |
| 560 | if (m_formatType == arrowsupport::Feather) |
| 561 | { |
| 562 | auto result = m_arrowFileWriter->Close(); |
| 563 | if (!result.ok()) |
| 564 | throwError("Unable to open to close file writer for file '" + filename() + |
| 565 | "' for with error: " + result.ToString()); |
| 566 | result = m_file->Close(); |
| 567 | if (!result.ok()) |
| 568 | throwError("Unable to open to write feather table for file '" + filename() + |
| 569 | "' with error: " + result.ToString()); |
| 570 | } |
| 571 | |
| 572 | if (m_formatType == arrowsupport::Parquet) |
| 573 | { |
| 574 | auto result = m_parquetFileWriter->Close(); |
| 575 | if (!result.ok()) |
| 576 | throwError("Unable to close FileWriter: " + result.ToString()); |
| 577 | |
| 578 | result = m_file->Close(); |
| 579 | if (!result.ok()) |
| 580 | throwError("Unable to close file: " + result.ToString()); |
| 581 | } |
| 582 | |
| 583 | log()->get(LogLevel::Debug) << "total memory allocated " |
| 584 | << m_pool->bytes_allocated() << std::endl; |
| 585 | } |
| 586 | |
| 587 | } // namespaces |