Skip to content

Commit f85d24c

Browse files
Jakub DubovskýJakub Dubovský
authored andcommitted
Test name changed, comments added
1 parent 1b20d51 commit f85d24c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/SparkContext.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,7 @@ object SparkContext extends Logging {
14111411

14121412
implicit def bytesWritableConverter(): WritableConverter[Array[Byte]] = {
14131413
simpleWritableConverter[Array[Byte], BytesWritable](bw =>
1414+
// getBytes method returns array which is longer then data to be returned
14141415
Arrays.copyOfRange(bw.getBytes, 0, bw.getLength)
14151416
)
14161417
}

core/src/test/scala/org/apache/spark/SparkContextSuite.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import org.scalatest.FunSuite
2222
import org.apache.hadoop.io.BytesWritable
2323

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

0 commit comments

Comments
 (0)