Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-805

listing empty HDFS directory returns an error instead of returning empty list

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.2.0, 0.3.0
    • Fix Version/s: 0.3.0
    • Component/s: C++
    • Labels:
      None

      Description

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

          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"); }
          }
      

      I think that should have an else:

          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");
            }
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                leif Leif Mortenson
                Reporter:
                leif Leif Mortenson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: