hvanhovell commented on code in PR #49111:
URL: https://github.com/apache/spark/pull/49111#discussion_r1941484904


##########
sql/api/src/main/scala/org/apache/spark/sql/internal/ToScalaUDF.scala:
##########
@@ -779,6 +779,16 @@ object UDFAdaptors extends Serializable {
   def mapToMapPartitions[V, U](f: MapFunction[V, U]): Iterator[V] => 
Iterator[U] =
     values => values.map(f.call)
 
+  def mapValues[IV, V](
+      vFunc: IV => V,
+      ivIsStruct: Boolean,
+      vIsStruct: Boolean): Iterator[IV] => Iterator[(Any, Any)] = {
+    val ivFunc = (iv: IV) => identity(iv)
+    val wrappedIvFunc = if (ivIsStruct) ivFunc else ivFunc.andThen(Tuple1(_))

Review Comment:
   As discussed offline. I don't think you have to do this wrapping.



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

To unsubscribe, e-mail: [email protected]

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