arrow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leif Walsh (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ARROW-805) listing empty HDFS directory returns an error instead of returning empty list
Date Tue, 11 Apr 2017 14:10:41 GMT
Leif Walsh created ARROW-805:
--------------------------------

             Summary: listing empty HDFS directory returns an error instead of returning empty
list
                 Key: ARROW-805
                 URL: https://issues.apache.org/jira/browse/ARROW-805
             Project: Apache Arrow
          Issue Type: Bug
    Affects Versions: 0.2.0, 0.3.0
            Reporter: Leif Walsh


https://github.com/apache/arrow/blob/master/cpp/src/arrow/io/hdfs.cc#L409-L410

{code}
    if (entries == nullptr) {
      // If the directory is empty, entries is NULL but errno is 0. Non-zero
      // errno indicates error
      //
      // Note: errno is thread-locala
      if (errno == 0) { num_entries = 0; }
      { return Status::IOError("HDFS: list directory failed"); }
    }
{code}

I think that should have an else:

{code}
    if (entries == nullptr) {
      // If the directory is empty, entries is NULL but errno is 0. Non-zero
      // errno indicates error
      //
      // Note: errno is thread-locala
      if (errno == 0) {
        num_entries = 0;
      } else {
        return Status::IOError("HDFS: list directory failed");
      }
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message