This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new 159975f2376 branch-2.1: [chore](load) optimize show create load error message #53694 (#53731) 159975f2376 is described below commit 159975f2376f8f22121252a6c7903c30a13deb82 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Sat Jul 26 23:56:37 2025 +0800 branch-2.1: [chore](load) optimize show create load error message #53694 (#53731) Cherry-picked from #53694 Co-authored-by: hui lai <lai...@selectdb.com> --- .../org/apache/doris/load/loadv2/LoadManager.java | 5 +++- .../broker_load/test_show_create_load.groovy | 34 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadManager.java b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadManager.java index b1a501cdf00..dd52f0c360d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadManager.java +++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/LoadManager.java @@ -559,7 +559,10 @@ public class LoadManager implements Writable { throw new DdlException("Label does not exist: " + label); } } else { - throw new DdlException("Database does not exist"); + // If dbId is not found in dbIdToLabelToLoadJobs, + // it means the database has no label records, + // so throw a "Label does not exist" error. + throw new DdlException("Label does not exist: " + label); } return result; } finally { diff --git a/regression-test/suites/load_p0/broker_load/test_show_create_load.groovy b/regression-test/suites/load_p0/broker_load/test_show_create_load.groovy new file mode 100644 index 00000000000..8881e35ef8e --- /dev/null +++ b/regression-test/suites/load_p0/broker_load/test_show_create_load.groovy @@ -0,0 +1,34 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_show_create_load", "load_p0") { + // test unknown db + try { + sql "show create load for unknown_db.test_label" + } catch (Exception e) { + logger.info("result: ${e.message}") + assertTrue(e.message.contains(" Unknown database 'unknown_db'")) + } + + // test unknown label + try { + sql "show create load for ${context.dbName}.unknown_label" + } catch (Exception e) { + logger.info("result: ${e.message}") + assertTrue(e.message.contains("Label does not exist: unknown_label")) + } +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org