Skip to content

Commit

Permalink
Avoids serializing generated projection code
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed May 12, 2015
1 parent edf49e7 commit 43ba50e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@ abstract class FSBasedRelation private[sql](
BoundReference(dataSchema.fieldIndex(col), field.dataType, field.nullable)
}.toSeq

val buildProjection = if (codegenEnabled) {
GenerateMutableProjection.generate(requiredOutput, dataSchema.toAttributes)
} else {
() => new InterpretedMutableProjection(requiredOutput, dataSchema.toAttributes)
}

buildScan(inputPaths).mapPartitions { rows =>
val buildProjection = if (codegenEnabled) {
GenerateMutableProjection.generate(requiredOutput, dataSchema.toAttributes)
} else {
() => new InterpretedMutableProjection(requiredOutput, dataSchema.toAttributes)
}

val mutableProjection = buildProjection()
rows.map(mutableProjection)
}
Expand Down

0 comments on commit 43ba50e

Please sign in to comment.