Skip to content

Commit 02df436

Browse files
nullccxsynullccxsy
andauthored
fix: correct return type of ArrowFileSystemFileIO functions( MakeMockFileIO, MakeLocalFileIO ) (#161)
change the return type of MakeMockFileIO, MakeLocalFileIO to FileIO --------- Co-authored-by: nullccxsy <[email protected]>
1 parent 3d617a8 commit 02df436

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/iceberg/arrow/arrow_fs_file_io.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ Status ArrowFileSystemFileIO::DeleteFile(const std::string& file_location) {
6969
return {};
7070
}
7171

72-
std::unique_ptr<::arrow::fs::FileSystem> ArrowFileSystemFileIO::MakeMockFileIO() {
73-
return std::make_unique<::arrow::fs::internal::MockFileSystem>(
74-
std::chrono::system_clock::now());
72+
std::unique_ptr<FileIO> ArrowFileSystemFileIO::MakeMockFileIO() {
73+
return std::make_unique<ArrowFileSystemFileIO>(
74+
std::make_shared<::arrow::fs::internal::MockFileSystem>(
75+
std::chrono::system_clock::now()));
7576
}
7677

77-
std::unique_ptr<::arrow::fs::FileSystem> ArrowFileSystemFileIO::MakeLocalFileIO() {
78-
return std::make_unique<::arrow::fs::LocalFileSystem>();
78+
std::unique_ptr<FileIO> ArrowFileSystemFileIO::MakeLocalFileIO() {
79+
return std::make_unique<ArrowFileSystemFileIO>(
80+
std::make_shared<::arrow::fs::LocalFileSystem>());
7981
}
8082

8183
} // namespace iceberg::arrow

src/iceberg/arrow/arrow_fs_file_io_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO {
3535
: arrow_fs_(std::move(arrow_fs)) {}
3636

3737
/// \brief Make an in-memory FileIO backed by arrow::fs::internal::MockFileSystem.
38-
static std::unique_ptr<::arrow::fs::FileSystem> MakeMockFileIO();
38+
static std::unique_ptr<FileIO> MakeMockFileIO();
3939

4040
/// \brief Make a local FileIO backed by arrow::fs::LocalFileSystem.
41-
static std::unique_ptr<::arrow::fs::FileSystem> MakeLocalFileIO();
41+
static std::unique_ptr<FileIO> MakeLocalFileIO();
4242

4343
~ArrowFileSystemFileIO() override = default;
4444

0 commit comments

Comments
 (0)