Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/16605
  
    Hi, @maropu .
    
    In the current master with your example, we can do the following. How do 
you think about this?
    
    ```scala
    scala> import scala.collection.mutable.WrappedArray
    import scala.collection.mutable.WrappedArray
    
    scala> val testArrayUdf = udf { (ar: WrappedArray[Int]) => ar.sum }
    testArrayUdf: org.apache.spark.sql.expressions.UserDefinedFunction = 
UserDefinedFunction(<function1>,IntegerType,Some(List(ArrayType(IntegerType,false))))
    
    scala> df.select(testArrayUdf($"ar")).show
    +-------+
    |UDF(ar)|
    +-------+
    |      1|
    +-------+
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to