Skip to content

[SPARK-43967][PYTHON] Support regular Python UDTFs with empty return values#42044

Closed
allisonwang-db wants to merge 1 commit into
apache:masterfrom
allisonwang-db:spark-43967-empty-return
Closed

[SPARK-43967][PYTHON] Support regular Python UDTFs with empty return values#42044
allisonwang-db wants to merge 1 commit into
apache:masterfrom
allisonwang-db:spark-43967-empty-return

Conversation

@allisonwang-db
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR adds support for regular (non-arrow-optimized) Python UDTFs that return empty results, for example:

def eval(self):
    ...

or

def eval(self):
    yield

This feature is already available in arrow-optimized UDTFs.

Why are the changes needed?

To align the behavior of regular Python UDTFs with arrow-optimized UDTFs.

Does this PR introduce any user-facing change?

Yes. After this PR, users can run regular Python UDTFs with empty return statement.

How was this patch tested?

Existing UTs.

@allisonwang-db
Copy link
Copy Markdown
Contributor Author

cc @HyukjinKwon

@HyukjinKwon
Copy link
Copy Markdown
Member

Merged to master and branch-3.5.

HyukjinKwon pushed a commit that referenced this pull request Jul 18, 2023
…values

### What changes were proposed in this pull request?
This PR adds support for regular (non-arrow-optimized) Python UDTFs that return empty results, for example:
```
def eval(self):
    ...
```
or
```
def eval(self):
    yield
```
This feature is already available in arrow-optimized UDTFs.

### Why are the changes needed?
To align the behavior of regular Python UDTFs with arrow-optimized UDTFs.

### Does this PR introduce _any_ user-facing change?

Yes. After this PR, users can run regular Python UDTFs with empty return statement.

### How was this patch tested?

Existing UTs.

Closes #42044 from allisonwang-db/spark-43967-empty-return.

Authored-by: allisonwang-db <allison.wang@databricks.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants