Skip to content

Commit c260513

Browse files
authored
feat(c++): close arrow::fs::InitializeS3 when arrow version <15 (#626)
Signed-off-by: Liu Jiajun <[email protected]>
1 parent 8c515ea commit c260513

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cpp/src/graphar/filesystem.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,24 @@ Result<std::shared_ptr<FileSystem>> FileSystemFromUriOrPath(
316316
return std::make_shared<FileSystem>(arrow_fs);
317317
}
318318

319+
// arrow::fs::InitializeS3 and arrow::fs::FinalizeS3 need arrow_version >= 15
319320
Status InitializeS3() {
320321
#if defined(ARROW_VERSION) && ARROW_VERSION > 14000000
321322
auto options = arrow::fs::S3GlobalOptions::Defaults();
322323
#else
323324
arrow::fs::S3GlobalOptions options;
324325
options.log_level = arrow::fs::S3LogLevel::Fatal;
325326
#endif
327+
#if defined(ARROW_VERSION) && ARROW_VERSION >= 15000000
326328
RETURN_NOT_ARROW_OK(arrow::fs::InitializeS3(options));
329+
#endif
327330
return Status::OK();
328331
}
329332

330333
Status FinalizeS3() {
334+
#if defined(ARROW_VERSION) && ARROW_VERSION >= 15000000
331335
RETURN_NOT_ARROW_OK(arrow::fs::FinalizeS3());
336+
#endif
332337
return Status::OK();
333338
}
334339

0 commit comments

Comments
 (0)