JingsongLi commented on code in PR #3307:
URL: https://github.com/apache/paimon/pull/3307#discussion_r1597348076


##########
paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/PaimonRecordReaderIterator.scala:
##########
@@ -84,7 +95,18 @@ case class PaimonRecordReaderIterator(reader: 
RecordReader[PaimonInternalRow])
       try {
         var stop = false
         while (!stop) {
-          currentResult = currentIterator.next
+          val dataRow = currentIterator.next()
+          if (dataRow != null) {
+            if (needMetadata && isFileRecordIterator) {
+              
updateMetadataRow(currentIterator.asInstanceOf[FileRecordIterator[PaimonInternalRow]])
+              currentResult = joinedRow.replace(dataRow, metadataRow)
+            } else {
+              currentResult = dataRow

Review Comment:
   needMetadata & is not FileRecordIterator
   Here should throw exception?



-- 
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]

Reply via email to