File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
repl/scala-2.11/src/test/scala/org/apache/spark/repl Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -473,4 +473,21 @@ class ReplSuite extends SparkFunSuite {
473473 assertDoesNotContain(" AssertionError" , output)
474474 assertDoesNotContain(" Exception" , output)
475475 }
476+
477+ test(" SPARK-18189: Fix serialization issue in KeyValueGroupedDataset" ) {
478+ val resultValue = 12345
479+ val output = runInterpreter(" local" ,
480+ s """
481+ |val keyValueGrouped = Seq((1, 2), (3, 4)).toDS().groupByKey(_._1)
482+ |val mapGroups = keyValueGrouped.mapGroups((k, v) => (k, 1))
483+ |val broadcasted = sc.broadcast( $resultValue)
484+ |
485+ |// Using broadcast triggers serialization issue in KeyValueGroupedDataset
486+ |val dataset = mapGroups.map(_ => broadcasted.value)
487+ |dataset.collect()
488+ """ .stripMargin)
489+ assertDoesNotContain(" error:" , output)
490+ assertDoesNotContain(" Exception" , output)
491+ assertContains(s " : Array[Int] = Array( $resultValue, $resultValue) " , output)
492+ }
476493}
You can’t perform that action at this time.
0 commit comments