ulysses-you commented on code in PR #39624: URL: https://github.com/apache/spark/pull/39624#discussion_r1131990280
########## sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala: ########## @@ -275,10 +272,22 @@ case class CachedRDDBuilder( storageLevel, cachedPlan.conf) } - val cached = cb.map { batch => - sizeInBytesStats.add(batch.sizeInBytes) - rowCountStats.add(batch.numRows) - batch + val cached = cb.mapPartitionsInternal { it => + new Iterator[CachedBatch] { + override def hasNext: Boolean = { Review Comment: sgtm -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org