Skip to content

Conversation

@xinrong-meng
Copy link
Member

@xinrong-meng xinrong-meng commented Mar 2, 2023

What changes were proposed in this pull request?

Implement spark.udf.registerJavaFunction and spark.udf.registerJavaUDAF.
A new proto JavaUDF is introduced.

Why are the changes needed?

Parity with vanilla PySpark.

Does this PR introduce any user-facing change?

Yes. spark.udf.registerJavaFunction and spark.udf.registerJavaUDAF are supported now.

How was this patch tested?

Parity unit tests.

SPARK-41661

@xinrong-meng xinrong-meng changed the title Implement spark.udf.registerJavaFunction [SPARK-42643][CONNECT][PYTHON] Implement spark.udf.registerJavaFunction Mar 2, 2023
@xinrong-meng xinrong-meng changed the title [SPARK-42643][CONNECT][PYTHON] Implement spark.udf.registerJavaFunction [WIP][SPARK-42643][CONNECT][PYTHON] Implement spark.udf.registerJavaFunction Mar 2, 2023
Copy link
Member Author

@xinrong-meng xinrong-meng Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaUDF has no deterministic field but the server doesn't have logic that relies on that field. So only the comment is changed to minimize changes to proto.

@xinrong-meng xinrong-meng changed the title [WIP][SPARK-42643][CONNECT][PYTHON] Implement spark.udf.registerJavaFunction [SPARK-42643][CONNECT][PYTHON] Implement spark.udf.registerJavaFunction Mar 6, 2023
@xinrong-meng xinrong-meng marked this pull request as ready for review March 6, 2023 08:34
@xinrong-meng
Copy link
Member Author

@xinrong-meng xinrong-meng changed the title [SPARK-42643][CONNECT][PYTHON] Implement spark.udf.registerJavaFunction [SPARK-42643][CONNECT][PYTHON] Register Java (aggregate) user-defined function Mar 6, 2023
@xinrong-meng xinrong-meng changed the title [SPARK-42643][CONNECT][PYTHON] Register Java (aggregate) user-defined function [SPARK-42643][CONNECT][PYTHON] Register Java (aggregate) user-defined functions Mar 6, 2023
@xinrong-meng
Copy link
Member Author

After double thoughts, I add spark.udf.registerJavaUDAF's implementation into this PR, since both APIs rely on the same proto message JavaUDF.

@HyukjinKwon
Copy link
Member

WDYT @hvanhovell ?

xinrong-meng added a commit that referenced this pull request Mar 8, 2023
… functions

### What changes were proposed in this pull request?
Implement `spark.udf.registerJavaFunction` and `spark.udf.registerJavaUDAF`.
 A new proto `JavaUDF` is introduced.

### Why are the changes needed?
Parity with vanilla PySpark.

### Does this PR introduce _any_ user-facing change?
Yes. `spark.udf.registerJavaFunction` and `spark.udf.registerJavaUDAF` are supported now.

### How was this patch tested?
Parity unit tests.

Closes #40244 from xinrong-meng/registerJava.

Authored-by: Xinrong Meng <[email protected]>
Signed-off-by: Xinrong Meng <[email protected]>
(cherry picked from commit 92aa087)
Signed-off-by: Xinrong Meng <[email protected]>
@xinrong-meng
Copy link
Member Author

Merged to master and branch-3.4, thanks all!

snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
… functions

### What changes were proposed in this pull request?
Implement `spark.udf.registerJavaFunction` and `spark.udf.registerJavaUDAF`.
 A new proto `JavaUDF` is introduced.

### Why are the changes needed?
Parity with vanilla PySpark.

### Does this PR introduce _any_ user-facing change?
Yes. `spark.udf.registerJavaFunction` and `spark.udf.registerJavaUDAF` are supported now.

### How was this patch tested?
Parity unit tests.

Closes apache#40244 from xinrong-meng/registerJava.

Authored-by: Xinrong Meng <[email protected]>
Signed-off-by: Xinrong Meng <[email protected]>
(cherry picked from commit 92aa087)
Signed-off-by: Xinrong Meng <[email protected]>
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