You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/12 17:39:18 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #9949: ARROW-6248: [Python][C++] Raise better exception on HDFS file open error

jorisvandenbossche commented on a change in pull request #9949:
URL: https://github.com/apache/arrow/pull/9949#discussion_r611828323



##########
File path: cpp/src/arrow/io/hdfs.cc
##########
@@ -497,12 +501,15 @@ class HadoopFileSystem::HadoopFileSystemImpl {
   Status OpenReadable(const std::string& path, int32_t buffer_size,
                       const io::IOContext& io_context,
                       std::shared_ptr<HdfsReadableFile>* file) {
+    errno = 0;
     hdfsFile handle = driver_->OpenFile(fs_, path.c_str(), O_RDONLY, buffer_size, 0, 0);
 
     if (handle == nullptr) {
-      const char* msg = !Exists(path) ? "HDFS file does not exist: "
-                                      : "HDFS path exists, but opening file failed: ";
-      return Status::IOError(msg, path);
+      if (errno) {

Review comment:
       Dummy question, since the `errno` variable is never passed to a libhdfs method, how can this ever have another value than 0?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org