spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-10429] [SQL] make mutableProjection ato...
Date Tue, 03 Nov 2015 03:32:59 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9422#discussion_r43713482
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Projection.scala
---
    @@ -79,7 +80,13 @@ case class InterpretedMutableProjection(expressions: Seq[Expression])
extends Mu
       override def apply(input: InternalRow): InternalRow = {
         var i = 0
         while (i < exprArray.length) {
    -      mutableRow(i) = exprArray(i).eval(input)
    +      // Store the result into buffer first, to make the projection atomic (needed by
aggregation)
    +      buffer(i) = exprArray(i).eval(input)
    +      i += 1
    +    }
    +    i = 0
    +    while (i < exprArray.length) {
    +      mutableRow(i) = buffer(i)
           i += 1
         }
         mutableRow
    --- End diff --
    
    should we assign null to `buffer` at the end?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message