mt40 commented on a change in pull request #27153: [SPARK-20384][SQL] Support 
value class in schema of Dataset (without breaking existing current projection)
URL: https://github.com/apache/spark/pull/27153#discussion_r366126962
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
 ##########
 @@ -753,6 +753,24 @@ object ScalaReflection extends ScalaReflection {
     }
   }
 
+  /**
+   * [SPARK-20384] Create an underlying param for a given parameter of value 
class.
+   * When a member of case class is value class `extends AnyVal`, the member's 
parameter type
+   * for encoder should be the underlying type. This is to be consistent with 
the generated
+   * type of that member, and avoid compile error.
+   * @param param param (type is consistent with 
[[ScalaReflection.getConstructorParameters]])
+   * @return unwrapped param
+   */
+  private def unwrapValueClassParam(param: (String, `Type`)): (String, `Type`) 
= {
+    val (name, typ) = param
 
 Review comment:
   nit: maybe use `tpe` instead of `typ` to be consistent with the naming in 
this file

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to