viirya commented on a change in pull request #31103:
URL: https://github.com/apache/spark/pull/31103#discussion_r554801933



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala
##########
@@ -1121,3 +1123,17 @@ class UDFRegistration private[sql] (functionRegistry: 
FunctionRegistry) extends
   // scalastyle:on line.size.limit
 
 }
+
+private[sql] object UDFRegistration {
+  /**
+   * Obtaining the schema of output encoder for `ScalaUDF`.
+   *
+   * As the serialization in `ScalaUDF` is for individual column, not the 
whole row,
+   * we just take the data type of vanilla object serializer, not `serializer` 
which
+   * is transformed somehow for top-level row.
+   */
+  def outputSchema(outputEncoder: ExpressionEncoder[_]): 
ScalaReflection.Schema = {

Review comment:
       I moved it out per 
https://github.com/apache/spark/pull/31103#discussion_r554405600. Do you think 
it is better to put in `ExpressionEncoder`?




----------------------------------------------------------------
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]



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

Reply via email to