Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20150#discussion_r161337159
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/memory.scala 
---
    @@ -122,6 +122,11 @@ case class MemoryStream[A : Encoder](id: Int, 
sqlContext: SQLContext)
           batches.slice(sliceStart, sliceEnd)
         }
     
    +    if (newBlocks.isEmpty) {
    --- End diff --
    
    nit: could you add an `assert(sliceStart <= sliceEnd, s"sliceStart: 
$sliceStart sliceEnd: $sliceEnd")` above `batches.slice(sliceStart, sliceEnd)` 
to make sure `getBatch` will not be called with wrong offsets.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to