Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/993#discussion_r13479600
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Projection.scala
---
@@ -48,14 +48,19 @@ class Projection(expressions: Seq[Expression]) extends
(Row => Row) {
* each time an input row is added. This significatly reduces the cost of
calcuating the
* projection, but means that it is not safe
*/
-case class MutableProjection(expressions: Seq[Expression]) extends (Row =>
Row) {
+case class InterpretedMutableProjection(expressions: Seq[Expression])
extends MutableProjection {
def this(expressions: Seq[Expression], inputSchema: Seq[Attribute]) =
this(expressions.map(BindReferences.bindReference(_, inputSchema)))
private[this] val exprArray = expressions.toArray
- private[this] val mutableRow = new GenericMutableRow(exprArray.size)
+ private[this] var mutableRow: MutableRow = new
GenericMutableRow(exprArray.size)
def currentValue: Row = mutableRow
+ def target(row: MutableRow): MutableProjection = {
--- End diff --
maybe add some scaladoc to explain how this is used?
---
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.
---