Skip to content

GH-50126: [C++] Make S3Filesystem consume key-value options - #50128

Draft
raulcd wants to merge 11 commits into
apache:mainfrom
raulcd:GH-50126
Draft

GH-50126: [C++] Make S3Filesystem consume key-value options#50128
raulcd wants to merge 11 commits into
apache:mainfrom
raulcd:GH-50126

Conversation

@raulcd

@raulcdraulcd commented Jun 8, 2026

Copy link
Copy Markdown
Member

TBD once the PR is not on draft anymore

This is a follow up PR from #50044 currently only opened to exercise CI.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

This PR includes breaking changes to public APIs. (If there are any breaking changes to public APIs, please explain which changes are breaking. If not, you can remove this.)

This PR contains a "Critical Fix". (If the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld), please provide explanation. If not, you can remove this.)

CopilotAI review requested due to automatic review settings June 8, 2026 15:48
@raulcdraulcd changed the title Gh 50126GH-50126: [C++] Make S3Filesystem consume key-value optionsJun 8, 2026
@github-actionsgithub-actionsBot added the awaiting committer review Awaiting committer review label Jun 8, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50126has been automatically assigned in GitHub to PR creator.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the C++ filesystem factory plumbing so FileSystemFromUri can pass backend-specific key/value options through to registered factories, and updates the S3 filesystem factory to actually consume a subset of those options (notably credentials) when constructing S3Options.

Changes:

  • Thread backend-specific std::any options through FileSystemFactory / FileSystemFromUri and add new FileSystemFromUri overloads accepting options.
  • Add S3Options::FromUriAndOptions(...) and update the S3 filesystem factory registration to use it.
  • Update/extend tests and CI/CMake so module tests are built and exercised when appropriate.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
FileDescription
cpp/src/arrow/testing/examplefs.ccUpdates the example filesystem factory to accept options and validate/consume them.
cpp/src/arrow/filesystem/s3fs.hAdds S3Options::FromUriAndOptions declarations and includes needed for std::any.
cpp/src/arrow/filesystem/s3fs.ccImplements FromUriAndOptions and wires S3 factory registration to consume options.
cpp/src/arrow/filesystem/s3fs_module_test.ccAdds module-level test coverage around options passed to S3 via FileSystemFromUri.
cpp/src/arrow/filesystem/localfs_test.ccExtends tests to validate options forwarding to dynamically loaded factories; adjusts registrar construction for nullptr cases.
cpp/src/arrow/filesystem/filesystem.hAdds options-aware factory signature and new FileSystemFromUri overload declarations + docs.
cpp/src/arrow/filesystem/filesystem.ccPlumbs options through the FileSystemFromUri* implementations and rejects options for non-factory schemes.
cpp/src/arrow/filesystem/filesystem_test.ccAdds a test asserting non-factory schemes reject non-empty options.
cpp/src/arrow/filesystem/CMakeLists.txtGates s3fs_module_test on ARROW_BUILD_TESTS in addition to ARROW_S3_MODULE.
ci/scripts/cpp_build.shEnsures ARROW_S3_MODULE is consistently set/forwarded to CMake in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadcpp/src/arrow/filesystem/filesystem.h Outdated
Comment threadcpp/src/arrow/testing/examplefs.cc Outdated
Comment threadcpp/src/arrow/filesystem/filesystem.h Outdated
Comment threadcpp/src/arrow/filesystem/filesystem.h Outdated
Comment threadcpp/src/arrow/filesystem/s3fs.cc Outdated
Comment threadcpp/src/arrow/filesystem/s3fs_module_test.cc
Comment threadcpp/src/arrow/testing/examplefs.cc
raulcd added 6 commits June 9, 2026 12:47
…f FileSystemFromUri, do not silently ignore non-empty options if underlying FS does not support them and use FileSystemFactoryOptions instead of std::vector<std::pair<std::string, std::any>> everywhere
… tests for FileSystemFromUriAndOptions and add a new one to test old behaviour

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Comment threadcpp/src/arrow/filesystem/s3fs.cc Outdated
Comment threadcpp/src/arrow/filesystem/s3fs.cc Outdated
Comment threadcpp/src/arrow/filesystem/s3fs_module_test.cc
CopilotAI review requested due to automatic review settings June 11, 2026 11:25

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Comment threadcpp/src/arrow/filesystem/filesystem.cc
Comment threadcpp/src/arrow/filesystem/s3fs.h
Comment threadcpp/src/arrow/filesystem/s3fs.cc Outdated
CopilotAI review requested due to automatic review settings June 12, 2026 07:18

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Comment threadcpp/src/arrow/filesystem/s3fs.h
Comment threadcpp/src/arrow/filesystem/s3fs.cc
Fix linting after rebase
Add s3 fs module test for FromUriAndOptionsCredentials and refactor S3Options::FromUri and S3Options::FromUriAndOptions
Add tests for FromUriAndOptions credentials
Add S3RetryStrategy to options
Add option for default_metadata
Minor fix
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@raulcd