Skip to content

Commit

Permalink
Minor changes to eliminate row object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Sep 10, 2014
1 parent 5b39cb9 commit 3dc1f94
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ private[sql] case class InMemoryRelation(
ColumnBuilder(columnType.typeId, initialBufferSize, attribute.name, useCompression)
}.toArray

var row: Row = null
var rowCount = 0

while (rowIterator.hasNext && rowCount < batchSize) {
row = rowIterator.next()
val row = rowIterator.next()
var i = 0
while (i < row.length) {
columnBuilders(i).appendFrom(row, i)
Expand Down Expand Up @@ -212,6 +210,7 @@ private[sql] case class InMemoryColumnarTableScan(
}.unzip
}

val nextRow = new SpecificMutableRow(requestedColumnDataTypes)
val rows = iterator
// Skip pruned batches
.filter { cachedBatch =>
Expand All @@ -233,7 +232,6 @@ private[sql] case class InMemoryColumnarTableScan(
}
// Extract rows via column accessors
.flatMap { columnAccessors =>
val nextRow = new SpecificMutableRow(requestedColumnDataTypes)
new Iterator[Row] {
override def next() = {
var i = 0
Expand Down

0 comments on commit 3dc1f94

Please sign in to comment.