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

    https://github.com/apache/spark/pull/20292#discussion_r162054413
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala
 ---
    @@ -463,21 +463,21 @@ class ExternalAppendOnlyMap[K, V, C](
     
         // An intermediate stream that reads from exactly one batch
         // This guards against pre-fetching and other arbitrary behavior of 
higher level streams
    -    private var deserializeStream = nextBatchStream()
    +    private var deserializeStream = 
null.asInstanceOf[Option[DeserializationStream]]
    --- End diff --
    
    Much better: `... deserializeStream: Option[DeserializationStream] = None`. 
It's not just the cast, but the fact that you're assigning null to an Option


---

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

Reply via email to