| 100 | } |
| 101 | |
| 102 | arrow::Status WriteFullFile(std::string path_to_file) { |
| 103 | // #include "parquet/arrow/writer.h" |
| 104 | // #include "arrow/util/type_fwd.h" |
| 105 | using parquet::ArrowWriterProperties; |
| 106 | using parquet::WriterProperties; |
| 107 | |
| 108 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<arrow::Table> table, GetTable()); |
| 109 | |
| 110 | // Choose compression |
| 111 | std::shared_ptr<WriterProperties> props = |
| 112 | WriterProperties::Builder().compression(arrow::Compression::SNAPPY)->build(); |
| 113 | |
| 114 | // Opt to store Arrow schema for easier reads back into Arrow |
| 115 | std::shared_ptr<ArrowWriterProperties> arrow_props = |
| 116 | ArrowWriterProperties::Builder().store_schema()->build(); |
| 117 | |
| 118 | std::shared_ptr<arrow::io::FileOutputStream> outfile; |
| 119 | ARROW_ASSIGN_OR_RAISE(outfile, arrow::io::FileOutputStream::Open(path_to_file)); |
| 120 | |
| 121 | ARROW_RETURN_NOT_OK( |
| 122 | parquet::arrow::WriteTable(*table.get(), arrow::default_memory_pool(), outfile, |
| 123 | /*chunk_size=*/64 * 1024, props, arrow_props)); |
| 124 | return arrow::Status::OK(); |
| 125 | } |
| 126 | |
| 127 | arrow::Status WriteInBatches(std::string path_to_file) { |
| 128 | // #include "parquet/arrow/writer.h" |
no test coverage detected