Skip to content

Commit

Permalink
Bug fix: NullableColumnAccessor.hasNext must take nulls into account
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Apr 11, 2014
1 parent 052bf41 commit 44591a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ private[sql] trait NullableColumnAccessor extends ColumnAccessor {

pos += 1
}

abstract override def hasNext = seenNulls < nullCount || super.hasNext
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ class NullableColumnAccessorSuite extends FunSuite {
val row = new GenericMutableRow(1)

(0 until 4).foreach { _ =>
assert(accessor.hasNext)
accessor.extractTo(row, 0)
assert(row(0) === randomRow(0))

assert(accessor.hasNext)
accessor.extractTo(row, 0)
assert(row.isNullAt(0))
}

assert(!accessor.hasNext)
}
}
}

0 comments on commit 44591a5

Please sign in to comment.