Github user drewrobb commented on a diff in the pull request:
https://github.com/apache/spark/pull/23062#discussion_r234844435
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/ScalaReflectionSuite.scala
---
@@ -109,6 +109,64 @@ object TestingUDT {
}
}
+/** An example derived from Twitter/Scrooge codegen for thrift */
+object ScroogeLikeExample {
+ def apply(
+ x: Int
+ ): ScroogeLikeExample =
+ new Immutable(
+ x
+ )
+
+ def unapply(_item: ScroogeLikeExample): _root_.scala.Option[Int] =
_root_.scala.Some(_item.x)
+
+ class Immutable(val x: Int) extends ScroogeLikeExample
+
+ trait Proxy extends ScroogeLikeExample {
+ protected def _underlying_ScroogeLikeExample: ScroogeLikeExample
+ override def x: Int = _underlying_ScroogeLikeExample.x
+ }
+}
+
+trait ScroogeLikeExample
+ extends _root_.scala.Product1[Int]
--- End diff --
It provides `productArity` used in `equals` used below.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]