Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/993#discussion_r15333592
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/package.scala
---
@@ -47,4 +47,30 @@ package org.apache.spark.sql.catalyst
* ==Evaluation==
* The result of expressions can be evaluated using the
`Expression.apply(Row)` method.
*/
-package object expressions
+package object expressions {
+
+ /**
+ * Converts a [[Row]] to another Row given a sequence of expression that
define each column of the
+ * new row. If the schema of the input row is specified, then the given
expression will be bound
+ * to that schema.
+ */
+ abstract class Projection extends (Row => Row)
+
+ /**
+ * Converts a [[Row]] to another Row given a sequence of expression that
define each column of the
+ * new row. If the schema of the input row is specified, then the given
expression will be bound
+ * to that schema.
+ *
+ * In contrast to a normal projection, a MutableProjection reuses the
same underlying row object
+ * each time an input row is added. This significantly reduces the cost
of calculating the
+ * projection, but means that it is not safe to hold on to a reference
to a [[Row]] after `next()`
+ * has been called on the [[Iterator]] that produced it. Instead, the
user must call `Row.copy()`
+ * and hold on to the returned [[Row]] before calling `next()`.
+ */
+ abstract class MutableProjection extends Projection {
+ def currentValue: Row
+
+ /** Updates the target of this projection to a new MutableRow */
--- End diff --
maybe ```Uses the given row to store the output of the projection.``` ?
---
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.
---