Skip to content

Commit

Permalink
feat(c++): close arrow::fs::InitializeS3 when arrow version <15 (#626)
Browse files Browse the repository at this point in the history
Signed-off-by: Liu Jiajun <85552719+jasinliu@users.noreply.github.com>
  • Loading branch information
jasinliu authored Sep 11, 2024
1 parent 8c515ea commit c260513
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cpp/src/graphar/filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,24 @@ Result<std::shared_ptr<FileSystem>> FileSystemFromUriOrPath(
return std::make_shared<FileSystem>(arrow_fs);
}

// arrow::fs::InitializeS3 and arrow::fs::FinalizeS3 need arrow_version >= 15
Status InitializeS3() {
#if defined(ARROW_VERSION) && ARROW_VERSION > 14000000
auto options = arrow::fs::S3GlobalOptions::Defaults();
#else
arrow::fs::S3GlobalOptions options;
options.log_level = arrow::fs::S3LogLevel::Fatal;
#endif
#if defined(ARROW_VERSION) && ARROW_VERSION >= 15000000
RETURN_NOT_ARROW_OK(arrow::fs::InitializeS3(options));
#endif
return Status::OK();
}

Status FinalizeS3() {
#if defined(ARROW_VERSION) && ARROW_VERSION >= 15000000
RETURN_NOT_ARROW_OK(arrow::fs::FinalizeS3());
#endif
return Status::OK();
}

Expand Down

0 comments on commit c260513

Please sign in to comment.