You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mgaido91 <gi...@git.apache.org> on 2018/10/22 19:09:28 UTC

[GitHub] spark pull request #22789: [SPARK-25767][SQL] Fix lazily evaluated stream of...

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

    https://github.com/apache/spark/pull/22789#discussion_r227008114
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala ---
    @@ -146,7 +146,7 @@ trait CodegenSupport extends SparkPlan {
           if (outputVars != null) {
             assert(outputVars.length == output.length)
             // outputVars will be used to generate the code for UnsafeRow, so we should copy them
    -        outputVars.map(_.copy())
    +        outputVars.map(_.copy()).toBuffer
    --- End diff --
    
    can we do something like:
    ```
    val res = outputVars.map(_.copy())
    res  match {
     case x: Stream => x.force
     case o => o
    }
    ```
    
    in order to avoid doing the `toBuffer` operation when not needed (please use more meaningful names than in my example in case it is feasible :) )?
    
    cc @hvanhovell who I remember fixed a similar issue with `Stream`s.


---

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