You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "juliuszsompolski (via GitHub)" <gi...@apache.org> on 2023/09/18 17:16:05 UTC

[GitHub] [spark] juliuszsompolski commented on pull request #42981: Refactor CloseableIterator#apply and test with Scala 2.13

juliuszsompolski commented on PR #42981:
URL: https://github.com/apache/spark/pull/42981#issuecomment-1724030970

   Thanks @LuciferYang !
   I can reproduce now. Looking at your looong stack trace in https://github.com/apache/spark/pull/42560#issuecomment-1718968002 I missed the fact that it's on scala2.13 :facepalm: . I was distracted between different flakes and failures... Now I can repro it.
   
   I tried to dig why, and I'm perplexed, because I have this failing:
   ```
     def apply[T](iterator: Iterator[T]): CloseableIterator[T] = {
       new Exception().printStackTrace()
       iterator match {
         case closeable: CloseableIterator[T] => closeable
         case _ =>
           val ret = new WrappedCloseableIterator[T] {
             override def innerIterator: Iterator[T] = iterator
           }
           assert(!(ret eq ret.innerIterator))
           ret
       }
     }
   ```
   And I get `assert(!(ret eq ret.innerIterator))` failing.
   How? ret is a new object I create. How could `innerIterator` be the same as the new object?
   
   Your fix does seem to fix it for me as well...


-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org