You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/02/13 12:40:14 UTC

[GitHub] [spark] hvanhovell commented on a change in pull request #27558: [SPARK-30806][SQL]Evaluate once per group in UnboundedWindowFunctionFrame

hvanhovell commented on a change in pull request #27558: [SPARK-30806][SQL]Evaluate once per group in UnboundedWindowFunctionFrame
URL: https://github.com/apache/spark/pull/27558#discussion_r378835132
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowFunctionFrame.scala
 ##########
 @@ -284,9 +284,7 @@ final class UnboundedWindowFunctionFrame(
 
   /** Write the frame columns for the current row to the given target row. */
   override def write(index: Int, current: InternalRow): Unit = {
-    // Unfortunately we cannot assume that evaluation is deterministic. So we need to re-evaluate
-    // for each row.
-    if (processor != null) {
+    if (processor != null && (index == 0)) {
 
 Review comment:
   I can't remember why I added this. Are you sure that computing the result of an aggregate (on its buffer) is always deterministic? If so then I am ok with this change.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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