8000 [BugFix] Fix the error message when create udf failed by trueeyu · Pull Request #60020 · StarRocks/starrocks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BugFix] Fix the error message when create udf failed #60020

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

Merged
merged 1 commit into from
Jun 19, 2025

Conversation

trueeyu
Copy link
Contributor
@trueeyu trueeyu commented Jun 18, 2025

Why I'm doing:

If I create a udf with an invalid symbol, starrocks will throw this exception to the user, so they won't get the real reason for the failure.

mysql> CREATE FUNCTION invalid_func(bigint) RETURNS bigint symbol = "SumbigintInvalid" type = "St
arrocksJar" file = "http://starrocks-thirdparty.oss-cn-zhangjiakou.aliyuncs.com/starrocks-jdbc%2FSumbigint.jar"

Error 1347 (HY000): Getting analyzing error. Detail message: '%s'.'%s' is not '%s'.

2025-06-18 11:59:19.899+08:00 INFO (starrocks-mysql-nio-pool-1|516) [StmtExecutor.execute():828] execute Exception, sql: CREATE FUNCTION invalid_func(bigint) RETURNS bigint symbol = "SumbigintInvalid" type = "St
arrocksJar" file = "http://starrocks-thirdparty.oss-cn-zhangjiakou.aliyuncs.com/starrocks-jdbc%2FSumbigint.jar", error: Getting analyzing error. Detail message: '%s'.'%s' is not '%s'.
    ERR_WRONG_OBJECT(1347, new byte[] {'H', 'Y', '0', '0', '0'}, "'%s'.'%s' is not '%s'"),

This error should be used as xxx_db.xxx_table is not an OLAP table, so we should not use this exception for class not found. However, I can't find a suitable exception, so I use ERR_COMMON_ERROR.

mysql> CREATE FUNCTION invalid_func(bigint) RETURNS bigint symbol = "SumbigintInvalid" type = "StarrocksJar" file = "http://starrocks-thirdparty.oss-cn-zhangjiakou.aliyuncs.com/starrocks-jdbc%2FSumbigint.jar";
ERROR 5064 (42000): Getting analyzing error. Detail message: Class 'SumbigintInvalid' not found in object_file :http://starrocks-thirdparty.oss-cn-zhangjiakou.aliyuncs.com/starrocks-jdbc%2FSumbigint.jar.

What I'm doing:

Fix the error message when create udf failed

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change: 8000

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.5
    • 3.4
    • 3.3

Signed-off-by: trueeyu <lxhhust350@qq.com>
@trueeyu trueeyu requested a review from a team as a code owner June 18, 2025 07:13
Copy link

Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[FE Incremental Coverage Report]

fail : 0 / 3 (00.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/sql/analyzer/CreateFunctionAnalyzer.java 0 3 00.00% [160, 163, 166]

Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@kangkaisen kangkaisen merged commit 7cc8487 into StarRocks:main Jun 19, 2025
89 of 90 checks passed
Copy link

@Mergifyio backport branch-3.5

Copy link

@Mergifyio backport branch-3.4

Copy link

@Mergifyio backport branch-3.3

@github-actions github-actions bot removed the 3.3 label Jun 19, 2025
Copy link
Contributor
mergify bot commented Jun 19, 2025

backport branch-3.5

✅ Backports have been created

Copy link
Contributor
mergify bot commented Jun 19, 2025

backport branch-3.4

✅ Backports have been created

Copy link
Contributor
mergify bot commented Jun 19, 2025

backport branch-3.3

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jun 19, 2025
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 7cc8487)
mergify bot pushed a commit that referenced this pull request Jun 19, 2025
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 7cc8487)

# Conflicts:
#	test/sql/test_udf/T/test_jvm_udf
mergify bot pushed a commit that referenced this pull request Jun 19, 2025
Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 7cc8487)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/sql/analyzer/CreateFunctionAnalyzer.java
#	test/sql/test_udf/R/test_jvm_udf
#	test/sql/test_udf/T/test_jvm_udf
wanpengfei-git pushed a commit that referenced this pull request Jun 19, 2025
… (#60049)

Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request Jun 19, 2025
… (#60048)

Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
AntiTopQuark pushed a commit to AntiTopQuark/starrocks that referenced this pull request Jun 19, 2025
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: AntiTopQuark <AntiTopQuark1350@outlook.com>
dengliu pushed a commit to dengliu/starrocks that referenced this pull request Jun 20, 2025
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.

4 participants
0