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

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.2.0, 0.3.0
    • 0.3.0
    • C++
    • 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

              leif Leif Mortenson
              leif Leif Mortenson
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: