sadikovi commented on code in PR #45578:
URL: https://github.com/apache/spark/pull/45578#discussion_r1529652672
##########
connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroUtils.scala:
##########
@@ -197,19 +197,19 @@ private[sql] object AvroUtils extends Logging {
def hasNextRow: Boolean = {
while (!completed && currentRow.isEmpty) {
- if (fileReader.pastSync(stopPosition)) {
+ // In some cases of empty blocks in an Avro file,
`fileReader.hasNext()` returns false but
+ // advances the cursor to the next block, so we need to call
`fileReader.hasNext()` again
+ // to correctly report whether the next record exists.
+ val r = (fileReader.hasNext || fileReader.hasNext) &&
!fileReader.pastSync(stopPosition)
Review Comment:
Thanks. I updated the code but I used `moreData` variable instead and `if
(!moreData)`.
--
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]