Github user HyukjinKwon commented on the issue:
https://github.com/apache/spark/pull/18906
For
https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ScalaUDF.scala#L42,
I don't think it's a public API.
So, Scala side are:
```scala
case class UserDefinedFunction protected[sql] (
f: AnyRef,
dataType: DataType,
inputTypes: Option[Seq[DataType]]) {
```
```scala
def udf[RT: TypeTag](f: Function0[RT]): UserDefinedFunction = {
```
```scala
def register[RT: TypeTag](name: String, func: Function0[RT]):
UserDefinedFunction = {
```
You are proposing adding `nullable` as below:
```python
class UserDefinedFunction(object):
"""
User defined function in Python
.. versionadded:: 1.3
"""
def __init__(self, func,
returnType=StringType(), name=None,
evalType=PythonEvalType.SQL_BATCHED_UDF,
nullable=True):
```
```python
def udf(f=None, returnType=StringType(), nullable=True):
```
```python
def registerFunction(self, name, f, returnType=StringType(), nullable=True):
```
I don't think these are quite consistent?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]