You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-46369: [C++] Add key-value pairs to the FileSystemFactory interface and to S3Options (#50044)
### Rationale for this change
From the issue description:
> From discussion on PR #41559 (comment) and the [mailing list](https://lists.apache.org/thread/ot4p23mc292p5103nfgrbyqpnhhp6clx), it's desirable to extend the filesystem factory interface to accept a set of key-value pairs in addition to a URL. This will draw a clearer distinction between filesystem options which are expected to be independent of the user (the URI, which should be reusable by multiple users) and options which are expected to be particular to a user (the key-value pairs, which may contain a user's keys/tokens/...). In particular it will remove the ambiguity of whether filesystem URIs must be guarded: URIs will not contain secrets and need not be guarded.
### What changes are included in this PR?
- A new options `FileSystemFactoryOptions`, added to `FileSystemFromUriAndOptions` which allows to pass via `FileSystemFromUriReal` through `FileSystemFactory::function`
- The `s3` and `local`/`file` factories are migrated to the new 4-arg signature.
- Schemes that do not yet consume options reject non-empty options with `NotImplemented` rather than silently dropping them.
- `examplefs` now reads two typed options and appends them to the output path, exercised by `arrow-filesystem-test`, proving `std::any` survives the `libarrow` to `arrow_filesystem_example.so` boundary.
- CI: `ci/scripts/cpp_build.sh` now forwards `ARROW_S3_MODULE` to CMake. The conda-cpp image was already setting `ARROW_S3_MODULE=ON`, but the flag was never passed through, so `s3fs_module_test` (added in #41559) had not actually been built or run in CI. This activates it.
- Added `access_key`, `secret_key`, `session_token`, `retry_strategy` and `default_metadata` as `FileSystemFactoryOptions` on `S3Options::FromUriAndOptions`.
- Tests exercising
### Are these changes tested?
Yes, new tests added to validate a dynamically-loaded filesystem is able to receive options via `std::any` and tests validating rejection if options passes to Filesystems that don't support it. Tests also added for `S3Options::FromUriAndOptions` receiving the new `FileSystemFactoryOptions` and usage on separate s3fs module
### Are there any user-facing changes?
New public `FileSystemFromUriOptions` taking an options list. Existing ones are unchanged.
* GitHub Issue: #46369
Lead-authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
0 commit comments