[ https://issues.apache.org/jira/browse/ARROW-805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15964439#comment-15964439 ]
Leif Walsh commented on ARROW-805: ---------------------------------- Does that fix look right? If so I can implement and test. > 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 > Fix For: 0.3.0 > > > 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)