Commit a5c88ec
[SPARK-28321][SQL] 0-args Java UDF should not be called only once
## What changes were proposed in this pull request?
0-args Java UDF alone calls the function even before making it as an expression.
It causes that the function always returns the same value and the function is called at driver side.
Seems like a mistake.
## How was this patch tested?
Unit test was added
Closes apache#25108 from HyukjinKwon/SPARK-28321.
Authored-by: HyukjinKwon <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>1 parent 507b745 commit a5c88ec
File tree
3 files changed
+19
-10
lines changed- sql/core/src
- main/scala/org/apache/spark/sql
- test/scala/org/apache/spark/sql
3 files changed
+19
-10
lines changedLines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
720 | | - | |
| 720 | + | |
721 | 721 | | |
722 | | - | |
| 722 | + | |
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3932 | 3932 | | |
3933 | 3933 | | |
3934 | 3934 | | |
3935 | | - | |
| 3935 | + | |
3936 | 3936 | | |
3937 | 3937 | | |
3938 | 3938 | | |
| |||
3944 | 3944 | | |
3945 | 3945 | | |
3946 | 3946 | | |
3947 | | - | |
3948 | | - | |
| 3947 | + | |
| 3948 | + | |
3949 | 3949 | | |
3950 | 3950 | | |
3951 | 3951 | | |
| |||
4145 | 4145 | | |
4146 | 4146 | | |
4147 | 4147 | | |
4148 | | - | |
4149 | | - | |
| 4148 | + | |
| 4149 | + | |
4150 | 4150 | | |
4151 | 4151 | | |
4152 | 4152 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
517 | 526 | | |
0 commit comments