You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/01/21 00:10:22 UTC
[doris] branch master updated: [Feature](profile) set sql and defaultDb fields in show-load-profile. (#15875)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 87c7f2fcc1 [Feature](profile) set sql and defaultDb fields in show-load-profile. (#15875)
87c7f2fcc1 is described below
commit 87c7f2fcc1ada506bcf79f6c1c92b393977d6c4d
Author: Xiangyu Wang <du...@gmail.com>
AuthorDate: Sat Jan 21 08:10:15 2023 +0800
[Feature](profile) set sql and defaultDb fields in show-load-profile. (#15875)
When execute show load profile '/', the value of SQL and DefaultDb columns are all 'N/A', but we can fill these fields,the result of this pr is as follows:
Execute show load profile '/'\G:
MySQL [test_d]> show load profile '/'\G
*************************** 1. row ***************************
QueryId: 652326
User: N/A
DefaultDb: default_cluster:test_d
SQL: LOAD LABEL `default_cluster:test_d`.`xxx` (APPEND DATA INFILE ('hdfs://xxx/user/hive/warehouse/xxx.db/xxx/*') INTO TABLE xxx FORMAT AS 'ORC' (c1, c2, c3) SET (`c1` = `c1`, `c2` = `c2`, `c3` = `c3`)) WITH BROKER broker_xxx (xxx) PROPERTIES ("max_filter_ratio" = "0", "timeout" = "30000")
QueryType: Load
StartTime: 2023-01-12 18:33:34
EndTime: 2023-01-12 18:33:46
TotalTime: 11s613ms
QueryState: N/A
1 row in set (0.01 sec)
---
.../main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java | 9 +++++++--
.../src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java | 4 ++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java
index 916771f573..4d7f56b638 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadJob.java
@@ -324,8 +324,8 @@ public class BrokerLoadJob extends BulkLoadJob {
summaryProfile.addInfoString(ProfileManager.QUERY_TYPE, "Load");
summaryProfile.addInfoString(ProfileManager.QUERY_STATE, "N/A");
summaryProfile.addInfoString(ProfileManager.USER, "N/A");
- summaryProfile.addInfoString(ProfileManager.DEFAULT_DB, "N/A");
- summaryProfile.addInfoString(ProfileManager.SQL_STATEMENT, "N/A");
+ summaryProfile.addInfoString(ProfileManager.DEFAULT_DB, getDefaultDb());
+ summaryProfile.addInfoString(ProfileManager.SQL_STATEMENT, this.getOriginStmt().originStmt);
summaryProfile.addInfoString(ProfileManager.IS_CACHED, "N/A");
// Add the summary profile to the first
@@ -334,6 +334,11 @@ public class BrokerLoadJob extends BulkLoadJob {
ProfileManager.getInstance().pushProfile(jobProfile);
}
+ private String getDefaultDb() {
+ Database database = Env.getCurrentEnv().getInternalCatalog().getDb(this.dbId).orElse(null);
+ return database == null ? "N/A" : database.getFullName();
+ }
+
private void updateLoadingStatus(BrokerLoadingTaskAttachment attachment) {
loadingStatus.replaceCounter(DPP_ABNORMAL_ALL,
increaseCounter(DPP_ABNORMAL_ALL, attachment.getCounter(DPP_ABNORMAL_ALL)));
diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
index a394a62d4a..602fd7a42d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BulkLoadJob.java
@@ -306,6 +306,10 @@ public abstract class BulkLoadJob extends LoadJob {
}
}
+ public OriginStatement getOriginStmt() {
+ return this.originStmt;
+ }
+
public void readFields(DataInput in) throws IOException {
super.readFields(in);
brokerDesc = BrokerDesc.read(in);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org