sunchao commented on a change in pull request #34369:
URL: https://github.com/apache/spark/pull/34369#discussion_r734842173
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileScanRDD.scala
##########
@@ -128,15 +139,21 @@ class FileScanRDD(
// Sets InputFileBlockHolder for the file block's information
InputFileBlockHolder.set(currentFile.filePath, currentFile.start,
currentFile.length)
+ resetCurrentIterator()
if (ignoreMissingFiles || ignoreCorruptFiles) {
currentIterator = new NextIterator[Object] {
// The readFunction may read some bytes before consuming the
iterator, e.g.,
- // vectorized Parquet reader. Here we use lazy val to delay the
creation of
- // iterator so that we will throw exception in `getNext`.
- private lazy val internalIter = readCurrentFile()
+ // vectorized Parquet reader. Here we use a lazily initialized
variable to delay the
+ // creation of iterator so that we will throw exception in
`getNext`.
+ private var internalIter: Iterator[InternalRow] = null
Review comment:
Got it. Thanks
--
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]