cloud-fan commented on a change in pull request #28979:
URL: https://github.com/apache/spark/pull/28979#discussion_r450875928



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDF.scala
##########
@@ -102,6 +105,25 @@ case class ScalaUDF(
     }
   }
 
+  /**
+   * Create the converter which converts the scala data type to the catalyst 
data type for
+   * the return data type of udf function. We'd use `ExpressionEncoder` to 
create the
+   * converter for typed ScalaUDF only, since its the only case where we know 
the type tag
+   * of the return data type of udf function.
+   */
+  private def catalystConverter: Any => Any = outputEncoder.map { enc =>
+    val toRow = enc.createSerializer()

Review comment:
       nit: `val toRow = enc.createSerializer().asInstanceOf[Any => Any]`




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to