| 271 | {} |
| 272 | |
| 273 | void ArrowWriter::initialize() |
| 274 | { |
| 275 | std::string ext = Utils::tolower(FileUtils::extension(filename())); |
| 276 | if (Utils::iequals("feather", m_formatString) || ext == ".feather") |
| 277 | m_formatType = arrowsupport::Feather; |
| 278 | if (Utils::iequals("parquet", m_formatString) || ext == ".parquet") |
| 279 | m_formatType = arrowsupport::Parquet; |
| 280 | |
| 281 | if (m_formatType == arrowsupport::Unknown) |
| 282 | throwError("Unknown format '" + m_formatString + "' provided. Unable to write array"); |
| 283 | |
| 284 | auto result = arrow::io::FileOutputStream::Open(filename(), /*append=*/false); |
| 285 | if (result.ok()) |
| 286 | m_file = result.ValueOrDie(); |
| 287 | else |
| 288 | throwError("Unable to open '" + filename() + "' for arrow output with error " + |
| 289 | result.status().ToString()); |
| 290 | } |
| 291 | |
| 292 | |
| 293 | bool ArrowWriter::processOne(PointRef& point) |