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

   @LuciferYang I did a comparison:
   ```
   class FooIter extends scala.collection.Iterator[Int] {
     var i = 0
   
     override def hasNext: Boolean = i < 10
   
     override def next(): Int = {
       i = i + 1
       println(s"$i")
       i
     }
   }
   
   val a = new FooIter()
   a.toBuffer
   
   val b = new FooIter()
   b.toSeq
   ```
   
   and in 2.13 I get
   ```
   val b: FooIter = <iterator>
   val res10: Seq[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
   ```
   
   while in 2.12 I get
   ```
   scala> b.toSeq
   1
   res1: Seq[Int] = Stream(1, ?)
   ```
   
   So it seems that in 2.13 `.toSeq` should be fine to materialize the 
stream... but as said above, it would be great to have a test...
   Actually, without access to `session` I think that does `val iter = 
client.execute` with something that has multiple responses, then `iter.toSeq`, 
then grabs the `ExecutePlanResponseReattachableIterator` from inside the iter 
and asserts that `resultComplete == true` would be sufficient.


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

Reply via email to