Multiple Filesystem subclasses are missing an override for Equals
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
Currently the `Filesystem` class contains two overloads for the `Equals` method:
`virtual bool Equals(const FileSystem& other) const = 0;`
`virtual bool Equals(const std::shared_ptr& other) const`
{ return Equals(\*other); }
The second is a trivial call to the first for ease of use. The first method is pure virtual and _must_ be overridden by subclasses. The problem is that overriding a single overload of a method also shadows all other overloads. As a result, it is no longer possible to call the `shared_ptr` version of the method. This appears to be the case for the `SubTreeFileSystem` and the `SlowFileSystem` in `filesystem.h` as well as the `S3FileSystem` in `s3fs.h`. There may be other classes with this problem as well, those are just the ones that I noticed. My guess is that what was intended here is to pull the method into the child class's namespace via a using declaration i.e. add `using FileSystem::Equals` to each child class.
**Reporter**: [Vyas Ramasubramani](https://issues.apache.org/jira/browse/ARROW-18217)
**Note**: *This issue was originally created as [ARROW-18217](https://issues.apache.org/jira/browse/ARROW-18217). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*
Contributor guide
Research direction
Start with the Equals overloads in filesystem.h and inspect SubTreeFileSystem and SlowFileSystem, then check S3FileSystem in s3fs.h and other FileSystem subclasses for the same overload-shadowing issue. Verify that each affected subclass exposes the shared_ptr overload while retaining its required comparison override, and run the relevant filesystem checks to confirm the overload is callable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100