Conversation
|
Ah, this will not work. If we want to remove cc @pitrou |
Well, ARROW_HDFS=ON could imply ARROW_FILESYSTEM=ON. I don't think that's a problem.
Yes, indeed. |
|
OK, I will then move |
e95f3f3 to
287cb9b
Compare
1bd3f43 to
8e26730
Compare
There was a problem hiding this comment.
Are all these declarations actually needed by PyArrow?
There was a problem hiding this comment.
No, most of them aren't and are copied from libarrow.pxd. I can remove the unused ones - but am not sure if some external application can actually use them?
There was a problem hiding this comment.
Don't we need to link to arrow::hadoop as was done above? cc @kou for advice
There was a problem hiding this comment.
Hm, yeah. I will add a link as above as it makes sense.
There was a problem hiding this comment.
Ah, it is there already (that explains why nothing failed =) )
arrow/cpp/src/arrow/CMakeLists.txt
Lines 857 to 861 in 53ef438
Not sure if the line with CMAKE_DL_LIBS is also needed here then?
There was a problem hiding this comment.
Ok, but we don't want to keep those two unofficial FileSystem and HadoopFileSystem classes which create confusion with the other (public) filesystem classes.
Ideally, those two classes disappear and their implementation code gets folded into the public HadoopFileSystem class.
If that's too annoying, we should at least merge those two classes and give them a less ambiguous name, for example HdfsClient.
There was a problem hiding this comment.
Ok, will go with the disappearing =)
IIUC hdfs_io.h will be removed altogether:
FileSystemandHadoopFileSystemwill go intohdfs.cc, folded into the publicHadoopFileSystemHdfsConnectionConfigwill also go intohdfs.cc- declarations that are left will go into
hdfs_internal.cc
There was a problem hiding this comment.
Most of these declarations should IMHO go into the arrow::filesystem::internal namespace, except for HdfsConnectionConfig which can go into arrow::filesystem.
|
Hi @pitrou, could you please take a quick look at the changes when you have a moment? I've done my best to implement the suggested changes, but am sure there's still room for improvement.
The Python and MATLAB test failures are not related. |
|
Hi @AlenkaF
I think you're misreading the output, the test is actually skipped when the driver fails unloading, which is normal: https://github.com/apache/arrow/actions/runs/15109276550/job/42464862030?pr=45998#step:7:3277 The problem is in the other tests, because it seems a destructor crashes: https://github.com/apache/arrow/actions/runs/15109276550/job/42464862030?pr=45998#step:7:3281 |
Hmm, rather than trying to find the exact explanation, a simple solution would be to change these functions into static methods, for example this: ARROW_EXPORT Status MakeReadableFile(const std::string& path, int32_t buffer_size,
const io::IOContext& io_context, LibHdfsShim* driver,
hdfsFS fs, hdfsFile file,
std::shared_ptr<HdfsReadableFile>* out);would become: class ARROW_EXPORT HdfsReadableFile : public RandomAccessFile {
public:
(...)
static Result<std::shared_ptr<HdfsReadableFile>> Make(
const std::string& path, int32_t buffer_size,
const io::IOContext& io_context, LibHdfsShim* driver,
hdfsFS fs, hdfsFile file); |
|
Aha, I see! Thanks, will look into it. |
|
@pitrou I cleaned up the CI failures (others are not related) and am hoping this changes will not be too bad to review :) |
72eae6e to
7810940
Compare
benibus
left a comment
There was a problem hiding this comment.
Thanks! This looks pretty good to me. Just a few comments.
c7beefc to
281b51a
Compare
|
@pitrou gentle ping. Would I be too optimistic to try to get it into 21.0.0? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
5b7f1bc to
053dcf8
Compare
|
@github-actions crossbow submit test-hdfs |
|
Revision: 053dcf8 Submitted crossbow builds: ursacomputing/crossbow @ actions-8fa7df5117
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical build and integration issues remain.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (2)
cpp/src/arrow/filesystem/hdfs_internal.cc:519
HdfsAnyFileImplis defined only in this translation unit, buthdfs.ccderives frominternal::HdfsAnyFileImplwhile the two files are compiled separately. Sincehdfs_internal.hdoes not declare this class, an HDFS build fails with an unknown base class; move the shared class declaration/definition to the internal header or keep the derived implementations in this source.
cpp/src/arrow/filesystem/hdfs_internal.cc:46- The code moved into this file uses
std::minandstd::numeric_limits, buthdfs_internal.ccno longer includes<algorithm>or<limits>(the oldio/hdfs.ccdid). Add both standard headers explicitly instead of relying on transitive includes, which can make HDFS builds fail on otherwise supported toolchains.
- Files reviewed: 17/17 changed files
- Comments generated: 3
- Review effort level: Lite
| endif() | ||
| if(ARROW_HDFS) | ||
| list(APPEND ARROW_FILESYSTEM_SRCS filesystem/hdfs.cc) | ||
| list(APPEND ARROW_FILESYSTEM_SRCS filesystem/hdfs.cc filesystem/hdfs_internal.cc) |
| std::unique_ptr<Impl> impl_; | ||
| }; | ||
|
|
||
| ARROW_EXPORT Status HaveLibHdfs(); |
| arrow_filesystem_srcs += [ | ||
| 'filesystem/hdfs.cc', | ||
| 'filesystem/hdfs_internal.cc', | ||
| ] |
|
OK, there are still some parts I need to fix. Will ping once I am done. |
Rationale for this change
ObjectTypeandFileStatisticsin io/hdfs.h have been deprecated for a while and can be removed.What changes are included in this PR?
ObjectTypeandFileStatisticsstructs are removed and instead FileSystem API inarrow::fsis used. Together with this change, the hdfs connected code is moved fromcpp/src/arrow/iotocpp/src/arrow/filesystemmergingFileSystemandHadoopFileSystemclasses fromarrow::iointo the publicHadoopFileSystemclass.Are these changes tested?
Existing tests should pass.
Are there any user-facing changes?
Deprecated structs are removed and all hdfs related code is now a part of the filesystem module.
Also closes: #22457 (not sure about
io/interfaces.h?)