Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/9825#discussion_r45391606
--- Diff:
repl/scala-2.10/src/test/scala/org/apache/spark/repl/ReplSuite.scala ---
@@ -278,6 +281,27 @@ class ReplSuite extends SparkFunSuite {
assertDoesNotContain("java.lang.ClassNotFoundException", output)
}
+ test("Datasets and encoders") {
+ val output = runInterpreter("local",
+ """
+ |import org.apache.spark.sql.functions._
+ |import org.apache.spark.sql.Encoder
+ |import org.apache.spark.sql.expressions.Aggregator
+ |import org.apache.spark.sql.TypedColumn
+ |val simpleSum = new Aggregator[Int, Int, Int] with Serializable {
+ | def zero: Int = 0 // The initial value.
+ | def reduce(b: Int, a: Int) = b + a // Add an element to the
running total
+ | def merge(b1: Int, b2: Int) = b1 + b2 // Merge intermediate
values.
+ | def finish(b: Int) = b // Return the final
result.
+ |}.toColumn
+ |
+ |val ds = Seq(1, 2, 3, 4).toDS()
+ |ds.select(simpleSum).collect
+ """.stripMargin)
+ assertDoesNotContain("error:", output)
+ assertDoesNotContain("Exception", output)
--- End diff --
This test case only fails on partial applications of this patch. In
particular with the classloader change
[here](https://github.com/apache/spark/pull/9825/files#diff-8bcc5aea39c73d4bf38aef6f6951d42cR532)
without the clasloader hack
[here](https://github.com/apache/spark/pull/9825/files#diff-bb538fda94224dd0af01d0fd7e1b4ea0R63).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]