| 310 | } |
| 311 | |
| 312 | ::arrow::Status OpenArrowFile( |
| 313 | std::shared_ptr<::arrow::io::RandomAccessFile>* file, |
| 314 | const std::string& filename) { |
| 315 | #if DEEPREC_ARROW_HDFS |
| 316 | if (filename.rfind("hdfs://", 0) == 0) { |
| 317 | ::arrow::internal::Uri uri; |
| 318 | ARROW_RETURN_NOT_OK(uri.Parse(filename)); |
| 319 | ARROW_ASSIGN_OR_RAISE(auto options, ::arrow::fs::HdfsOptions::FromUri(uri)); |
| 320 | std::shared_ptr<::arrow::io::HadoopFileSystem> fs; |
| 321 | ARROW_RETURN_NOT_OK(::arrow::io::HadoopFileSystem::Connect( |
| 322 | &options.connection_config, &fs)); |
| 323 | std::shared_ptr<::arrow::io::HdfsReadableFile> hdfs_file; |
| 324 | ARROW_RETURN_NOT_OK(fs->OpenReadable(uri.path(), &hdfs_file)); |
| 325 | *file = hdfs_file; |
| 326 | return ::arrow::Status::OK(); |
| 327 | } |
| 328 | #endif |
| 329 | auto fs = std::make_shared<::arrow::fs::LocalFileSystem>(); |
| 330 | ARROW_ASSIGN_OR_RAISE(*file, fs->OpenInputFile(filename)); |
| 331 | return ::arrow::Status::OK(); |
| 332 | } |
| 333 | |
| 334 | ::arrow::Status OpenParquetReader( |
| 335 | std::unique_ptr<::parquet::arrow::FileReader>* reader, |
no test coverage detected