Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/9819#discussion_r47453214
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/Window.scala ---
@@ -736,15 +691,148 @@ private[execution] final class
UnboundedFollowingWindowFunctionFrame(
// Only recalculate and update when the buffer changes.
if (bufferUpdated) {
- evaluatePrepared(buffer, inputIndex, buffer.length)
- fill(target, outputIndex)
+ processor.initialize(input.size)
+ processor.update(input, inputIndex, input.size)
+ processor.evaluate(target)
}
// Move to the next row.
outputIndex += 1
}
+}
+
+/**
+ * This class prepares and manages the processing of a number of aggregate
functions.
+ *
+ * This implementation only supports evaluation in [[Complete]] mode. This
is enough for
+ * Window processing.
+ *
+ * Processing of distinct aggregates is currently not supported.
+ *
+ * The implementation is split into an object which takes care of
construction, and a the actual
+ * processor class. Construction might be expensive and could be separated
into a 'driver' and a
+ * 'executor' part.
+ */
+private[execution] object AggregateProcessor {
+ def apply(functions: Array[Expression],
+ ordinal: Int,
+ inputAttributes: Seq[Attribute],
+ newMutableProjection: (Seq[Expression], Seq[Attribute]) => () =>
MutableProjection):
--- End diff --
format
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]