Description
Support UDTFs with empty returns, for example:
@udtf(returnType="a: int") class TestUDTF: def eval(self, a: int): ...
Currently, this will fail with the exception
TypeError: 'NoneType' object is not iterable
Another example
class TestUDTF: def eval(self, a: int): yield
This will fail with the exceptions
java.lang.NullPointerException
Note, arrow-optimized UDTFs already support this. This error only occurs with regular Python UDTFs.
Fixed in https://github.com/apache/spark/pull/42044