Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21611#discussion_r200127948
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
---
@@ -798,7 +798,11 @@ object ScalaReflection extends ScalaReflection {
* Whether the fields of the given type is defined entirely by its
constructor parameters.
*/
def definedByConstructorParams(tpe: Type): Boolean =
cleanUpReflectionObjects {
- tpe.dealias <:< localTypeOf[Product] || tpe.dealias <:<
localTypeOf[DefinedByConstructorParams]
+ tpe.dealias match {
+ case t if t <:< localTypeOf[Option[_]] =>
definedByConstructorParams(t.typeArgs.head)
--- End diff --
we should add some comments: Option is a Product but don't wanna treat
`Option[Int]` as a struct type
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]