Skip to content

Commit

Permalink
Test name changed, comments added
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Dubovský authored and Jakub Dubovský committed Oct 11, 2014
1 parent 1b20d51 commit f85d24c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ object SparkContext extends Logging {

implicit def bytesWritableConverter(): WritableConverter[Array[Byte]] = {
simpleWritableConverter[Array[Byte], BytesWritable](bw =>
// getBytes method returns array which is longer then data to be returned
Arrays.copyOfRange(bw.getBytes, 0, bw.getLength)
)
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/test/scala/org/apache/spark/SparkContextSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import org.scalatest.FunSuite
import org.apache.hadoop.io.BytesWritable

class SparkContextSuite extends FunSuite {
test("test of writing spark scala test") {
//Regression test for SPARK-3121
test("BytesWritable implicit conversion is correct") {
val bytesWritable = new BytesWritable()
val inputArray = (1 to 10).map(_.toByte).toArray
bytesWritable.set(inputArray, 0, 10)
Expand Down

0 comments on commit f85d24c

Please sign in to comment.