You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by fo...@apache.org on 2025/08/07 13:57:57 UTC
(iceberg-cpp) branch main updated: fix: correct return type of ArrowFileSystemFileIO functions( MakeMockFileIO, MakeLocalFileIO ) (#161)
This is an automated email from the ASF dual-hosted git repository.
fokko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new 02df436 fix: correct return type of ArrowFileSystemFileIO functions( MakeMockFileIO, MakeLocalFileIO ) (#161)
02df436 is described below
commit 02df436c7cb4a6b01a5de5f9d064a06252ce4fdf
Author: nullccxsy <81...@users.noreply.github.com>
AuthorDate: Thu Aug 7 21:57:51 2025 +0800
fix: correct return type of ArrowFileSystemFileIO functions( MakeMockFileIO, MakeLocalFileIO ) (#161)
change the return type of MakeMockFileIO, MakeLocalFileIO to FileIO
---------
Co-authored-by: nullccxsy <32...@qq.com>
---
src/iceberg/arrow/arrow_fs_file_io.cc | 12 +++++++-----
src/iceberg/arrow/arrow_fs_file_io_internal.h | 4 ++--
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/iceberg/arrow/arrow_fs_file_io.cc b/src/iceberg/arrow/arrow_fs_file_io.cc
index 5c1523e..251455d 100644
--- a/src/iceberg/arrow/arrow_fs_file_io.cc
+++ b/src/iceberg/arrow/arrow_fs_file_io.cc
@@ -69,13 +69,15 @@ Status ArrowFileSystemFileIO::DeleteFile(const std::string& file_location) {
return {};
}
-std::unique_ptr<::arrow::fs::FileSystem> ArrowFileSystemFileIO::MakeMockFileIO() {
- return std::make_unique<::arrow::fs::internal::MockFileSystem>(
- std::chrono::system_clock::now());
+std::unique_ptr<FileIO> ArrowFileSystemFileIO::MakeMockFileIO() {
+ return std::make_unique<ArrowFileSystemFileIO>(
+ std::make_shared<::arrow::fs::internal::MockFileSystem>(
+ std::chrono::system_clock::now()));
}
-std::unique_ptr<::arrow::fs::FileSystem> ArrowFileSystemFileIO::MakeLocalFileIO() {
- return std::make_unique<::arrow::fs::LocalFileSystem>();
+std::unique_ptr<FileIO> ArrowFileSystemFileIO::MakeLocalFileIO() {
+ return std::make_unique<ArrowFileSystemFileIO>(
+ std::make_shared<::arrow::fs::LocalFileSystem>());
}
} // namespace iceberg::arrow
diff --git a/src/iceberg/arrow/arrow_fs_file_io_internal.h b/src/iceberg/arrow/arrow_fs_file_io_internal.h
index 4f8509d..f151c7a 100644
--- a/src/iceberg/arrow/arrow_fs_file_io_internal.h
+++ b/src/iceberg/arrow/arrow_fs_file_io_internal.h
@@ -35,10 +35,10 @@ class ICEBERG_BUNDLE_EXPORT ArrowFileSystemFileIO : public FileIO {
: arrow_fs_(std::move(arrow_fs)) {}
/// \brief Make an in-memory FileIO backed by arrow::fs::internal::MockFileSystem.
- static std::unique_ptr<::arrow::fs::FileSystem> MakeMockFileIO();
+ static std::unique_ptr<FileIO> MakeMockFileIO();
/// \brief Make a local FileIO backed by arrow::fs::LocalFileSystem.
- static std::unique_ptr<::arrow::fs::FileSystem> MakeLocalFileIO();
+ static std::unique_ptr<FileIO> MakeLocalFileIO();
~ArrowFileSystemFileIO() override = default;