cloud-fan commented on code in PR #57588:
URL: https://github.com/apache/spark/pull/57588#discussion_r3671683753
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SupportsArchiveFormat.scala:
##########
@@ -312,17 +392,17 @@ object SupportsArchiveFormat {
case c: Closeable => try c.close() catch { case NonFatal(_) => }
case _ =>
}
- var entry = archive.getNextEntry
- while (entry != null && shouldSkipEntry(entry,
ignoredPathSegmentRegex)) {
- entry = archive.getNextEntry
+ var next: (ArchiveEntry, InputStream) = null
+ while (next == null && archive.hasNext) {
+ val entry = archive.next()
+ if (!shouldSkipEntry(entry._1, ignoredPathSegmentRegex)) next =
entry
}
- if (entry == null) {
+ if (next == null) {
done = true
cleanup()
} else {
- // CloseShieldInputStream ignores close(), so a parser closing its
input does not close
- // the archive; any unread remainder is skipped by getNextEntry()
when advancing.
- currentIter = parseEntry(entry,
CloseShieldInputStream.wrap(archive))
+ // the entry stream; any unread remainder is skipped when the
archive advances.
Review Comment:
The deleted lead-in left this comment as a sentence fragment.
```suggestion
// Parse the entry stream; any unread remainder is skipped when
the archive advances.
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]