Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-30339][SQL][2.4] Avoid to fail twice in function lookup #27054

Closed
wants to merge 1 commit into from

Conversation

wzhfy
Copy link
Contributor

@wzhfy wzhfy commented Dec 31, 2019

What changes were proposed in this pull request?

Backported from pr#26994. Currently if function lookup fails, spark will give it a second chance by casting decimal type to double type. But for cases where decimal type doesn't exist, it's meaningless to lookup again and cause extra cost like unnecessary metastore access. We should throw exceptions directly in these cases.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Covered by existing tests.

### What changes were proposed in this pull request?

Currently if function lookup fails, spark will give it a second change by casting decimal type to double type. But for cases where decimal type doesn't exist, it's meaningless to lookup again and causes extra cost like unnecessary metastore access. We should throw exceptions directly in these cases.

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

No.

### How was this patch tested?

Covered by existing tests.

Closes apache#26994 from wzhfy/avoid_udf_fail_twice.

Authored-by: Zhenhua Wang <wzh_zju@163.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
@SparkQA
Copy link

SparkQA commented Dec 31, 2019

Test build #115979 has finished for PR 27054 at commit 912eaf0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wzhfy wzhfy changed the title [SPARK-30339][SQL][branch-2.4] Avoid to fail twice in function lookup [SPARK-30339][SQL][2.4] Avoid to fail twice in function lookup Dec 31, 2019
wzhfy added a commit that referenced this pull request Dec 31, 2019
### What changes were proposed in this pull request?

Backported from [pr#26994](#26994). Currently if function lookup fails, spark will give it a second chance by casting decimal type to double type. But for cases where decimal type doesn't exist, it's meaningless to lookup again and cause extra cost like unnecessary metastore access. We should throw exceptions directly in these cases.

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

No.

### How was this patch tested?

Covered by existing tests.

Closes #27054 from wzhfy/avoid_udf_fail_twice-2.4.

Authored-by: Zhenhua Wang <wzh_zju@163.com>
Signed-off-by: Zhenhua Wang <wzh_zju@163.com>
@wzhfy
Copy link
Contributor Author

wzhfy commented Dec 31, 2019

thanks, merged to branch-2.4

@wzhfy wzhfy closed this Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants