You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by cloud-fan <gi...@git.apache.org> on 2018/10/09 13:03:23 UTC
[GitHub] spark pull request #21732: [SPARK-24762][SQL] Enable Option of Product encod...
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/21732#discussion_r223690604
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala ---
@@ -135,19 +135,62 @@ object ScalaReflection extends ScalaReflection {
* from ordinal 0 (since there are no names to map to). The actual location can be moved by
* calling resolve/bind with a new schema.
*/
- def deserializerFor[T : TypeTag]: Expression = {
+ def deserializerFor[T : TypeTag]: Expression = cleanUpReflectionObjects {
val tpe = localTypeOf[T]
val clsName = getClassNameFromType(tpe)
val walkedTypePath = s"""- root class: "$clsName"""" :: Nil
- val expr = deserializerFor(tpe, None, walkedTypePath)
- val Schema(_, nullable) = schemaFor(tpe)
+ val Schema(dataType, tpeNullable) = schemaFor(tpe)
+ val isOptionOfProduct = tpe.dealias <:< localTypeOf[Option[_]] &&
--- End diff --
can we reuse the `optionOfProductType`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org