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 a6bda81dba [Fix](profile) fix `/query_profile` action. (#16540)
a6bda81dba is described below

commit a6bda81dbaab11f5d2babfbe0363bfaea3034aa0
Author: Xiangyu Wang <dut.xian...@gmail.com>
AuthorDate: Wed Feb 15 14:27:21 2023 +0800

    [Fix](profile) fix `/query_profile` action. (#16540)
    
    Co-authored-by: wangxian...@360shuke.com <wangxian...@360shuke.com>
---
 .../org/apache/doris/httpv2/controller/QueryProfileController.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java
 
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java
index 45178a860c..53744f4fc8 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/QueryProfileController.java
@@ -22,6 +22,7 @@ import org.apache.doris.httpv2.entity.ResponseBody;
 import org.apache.doris.httpv2.entity.ResponseEntityBuilder;
 
 import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import org.apache.logging.log4j.LogManager;
@@ -35,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 @RestController
 @RequestMapping("/rest/v1")
@@ -43,6 +45,7 @@ public class QueryProfileController extends BaseController {
 
     private static final String ID = "id";
     private static final String DETAIL_COL = "Detail";
+    private static final Set<String> QUERY_ID_TYPES = ImmutableSet.of("Query", 
"Insert");
 
     @RequestMapping(path = "/query_profile/{" + ID + "}", method = 
RequestMethod.GET)
     public Object profile(@PathVariable(value = ID) String id) {
@@ -96,7 +99,7 @@ public class QueryProfileController extends BaseController {
             List<String> realRow = Lists.newLinkedList(row);
 
             String queryType = realRow.get(queryTypeIndex);
-            String id = "Query".equals(queryType) ? realRow.get(queryIdIndex) 
: realRow.get(jobIdIndex);
+            String id = (QUERY_ID_TYPES.contains(queryType)) ? 
realRow.get(queryIdIndex) : realRow.get(jobIdIndex);
 
             realRow.add(0, id);
             Map<String, Object> rowMap = new HashMap<>();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to