Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/22309#discussion_r225030352 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala --- @@ -376,6 +387,23 @@ object ScalaReflection extends ScalaReflection { dataType = ObjectType(udt.getClass)) Invoke(obj, "deserialize", ObjectType(udt.userClass), getPath :: Nil) + case t if isValueClass(t) => + // nested value class is treated as its underlying type + // top level value class must be treated as a product + val underlyingType = getUnderlyingTypeOf(t) + val underlyingClsName = getClassNameFromType(underlyingType) + val clsName = t.typeSymbol.asClass.fullName + val newTypePath = s"""- Scala value class: $clsName($underlyingClsName)""" +: + walkedTypePath + + val arg = deserializerFor(underlyingType, path, newTypePath) + if (path.isDefined) { + arg --- End diff -- why can we skip the `NewInstance`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org