This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 7844a651071 branch-3.0: [chore](load) optimize show create load error
message #53694 (#53730)
7844a651071 is described below
commit 7844a651071e30a3408a9086ed7fe1b597529029
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jul 23 09:52:06 2025 +0800
branch-3.0: [chore](load) optimize show create load error message #53694
(#53730)
Cherry-picked from #53694
Co-authored-by: hui lai <[email protected]>
---
.../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 f661513cd66..89f7df1fcf8 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
@@ -553,7 +553,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: [email protected]
For additional commands, e-mail: [email protected]