You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org> on 2024/03/19 08:05:46 UTC

[PR] [disable feature](show profile) Disable show query/load profile stmt [doris]

zhiqiang-hhhh opened a new pull request, #32467:
URL: https://github.com/apache/doris/pull/32467

   show query/load profile from terminal is actually not a well maintained feature, and our execution model changed a lot in 2.1 which introduced new execution engine, it will cost much to keep show profile stmt work with new execution engine. 
   
   So, we disable it, and user will get a prompt to guide them get profile from web browser like bellow
   ```sql
   show load profile "/512b998305c3455d-9e8ea49e520486a6"
   --------------
   
   ERROR 1105 (HY000): errCode = 2, detailMessage = try visit http://127.0.0.1:5937/QueryProfile//512b998305c3455d-9e8ea49e520486a6, show query/load profile syntax is a deprecated feature
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [opt](profile) Disable show query/load profile stmt [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #32467:
URL: https://github.com/apache/doris/pull/32467


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [opt](profile) Disable show query/load profile stmt [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32467:
URL: https://github.com/apache/doris/pull/32467#issuecomment-2016029183

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [disable feature](show profile) Disable show query/load profile stmt [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #32467:
URL: https://github.com/apache/doris/pull/32467#issuecomment-2006211117

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)
   
   Since 2024-03-18, the Document has been moved to [doris-website](https://github.com/apache/doris-website).
   See [Doris Document](https://cwiki.apache.org/confluence/display/DORIS/Doris+Document).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [opt](profile) Disable show query/load profile stmt [doris]

Posted by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org>.
zhiqiang-hhhh commented on code in PR #32467:
URL: https://github.com/apache/doris/pull/32467#discussion_r1531551094


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ShowExecutor.java:
##########
@@ -2390,116 +2384,21 @@ private void handleShowPlugins() throws AnalysisException {
     }
 
     private void handleShowQueryProfile() throws AnalysisException {
-        ShowQueryProfileStmt showStmt = (ShowQueryProfileStmt) stmt;
-        ShowQueryProfileStmt.PathType pathType = showStmt.getPathType();
-        List<List<String>> rows = Lists.newArrayList();
-        switch (pathType) {
-            case QUERY_IDS:
-                rows = ProfileManager.getInstance().getQueryWithType(ProfileManager.ProfileType.QUERY);
-                break;
-            case FRAGMENTS: {
-                ProfileTreeNode treeRoot = ProfileManager.getInstance().getFragmentProfileTree(showStmt.getQueryId(),
-                        showStmt.getQueryId());
-                if (treeRoot == null) {
-                    throw new AnalysisException("Failed to get fragment tree for query: " + showStmt.getQueryId());
-                }
-                List<String> row = Lists.newArrayList(ProfileTreePrinter.printFragmentTree(treeRoot));
-                rows.add(row);
-                break;
-            }
-            case INSTANCES: {
-                // For query profile, there should be only one execution profile,
-                // And the execution id is same as query id
-                List<Triple<String, String, Long>> instanceList
-                        = ProfileManager.getInstance().getFragmentInstanceList(
-                        showStmt.getQueryId(), showStmt.getQueryId(), showStmt.getFragmentId());
-                if (instanceList == null) {
-                    throw new AnalysisException("Failed to get instance list for fragment: "
-                            + showStmt.getFragmentId());
-                }
-                for (Triple<String, String, Long> triple : instanceList) {
-                    List<String> row = Lists.newArrayList(triple.getLeft(), triple.getMiddle(),
-                            RuntimeProfile.printCounter(triple.getRight(), TUnit.TIME_NS));
-                    rows.add(row);
-                }
-                break;
-            }
-            case SINGLE_INSTANCE: {
-                // For query profile, there should be only one execution profile,
-                // And the execution id is same as query id
-                ProfileTreeNode treeRoot = ProfileManager.getInstance().getInstanceProfileTree(showStmt.getQueryId(),
-                        showStmt.getQueryId(), showStmt.getFragmentId(), showStmt.getInstanceId());
-                if (treeRoot == null) {
-                    throw new AnalysisException("Failed to get instance tree for instance: "
-                            + showStmt.getInstanceId());
-                }
-                List<String> row = Lists.newArrayList(ProfileTreePrinter.printInstanceTree(treeRoot));
-                rows.add(row);
-                break;
-            }
-            default:
-                break;
-        }
-
-        resultSet = new ShowResultSet(showStmt.getMetaData(), rows);
+        String selfHost = Env.getCurrentEnv().getSelfNode().getHost();
+        int httpPort = Config.http_port;
+        String terminalMsg = String.format(
+                "try visit http://%s:%d/QueryProfile, show query/load profile syntax is a deprecated feature",

Review Comment:
   > how to ensure it could return a visitable url for user. for example, doris behind a net gateway, and user have no access privilege for it
   
   no guarantee for now. this can be fixed by introduce a new syntax like `explain analyze`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Disable show query/load profile stmt [doris]

Posted by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org>.
zhiqiang-hhhh commented on PR #32467:
URL: https://github.com/apache/doris/pull/32467#issuecomment-2006460974

   run buildall


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Disable show query/load profile stmt [doris]

Posted by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org>.
zhiqiang-hhhh commented on PR #32467:
URL: https://github.com/apache/doris/pull/32467#issuecomment-2006265486

   run compile


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [opt](profile) Disable show query/load profile stmt [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32467:
URL: https://github.com/apache/doris/pull/32467#issuecomment-2016029212

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] Disable show query/load profile stmt [doris]

Posted by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org>.
zhiqiang-hhhh commented on PR #32467:
URL: https://github.com/apache/doris/pull/32467#issuecomment-2006330184

   run compile


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [opt](profile) Disable show query/load profile stmt [doris]

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #32467:
URL: https://github.com/apache/doris/pull/32467#discussion_r1531494282


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ShowExecutor.java:
##########
@@ -2390,116 +2384,21 @@ private void handleShowPlugins() throws AnalysisException {
     }
 
     private void handleShowQueryProfile() throws AnalysisException {
-        ShowQueryProfileStmt showStmt = (ShowQueryProfileStmt) stmt;
-        ShowQueryProfileStmt.PathType pathType = showStmt.getPathType();
-        List<List<String>> rows = Lists.newArrayList();
-        switch (pathType) {
-            case QUERY_IDS:
-                rows = ProfileManager.getInstance().getQueryWithType(ProfileManager.ProfileType.QUERY);
-                break;
-            case FRAGMENTS: {
-                ProfileTreeNode treeRoot = ProfileManager.getInstance().getFragmentProfileTree(showStmt.getQueryId(),
-                        showStmt.getQueryId());
-                if (treeRoot == null) {
-                    throw new AnalysisException("Failed to get fragment tree for query: " + showStmt.getQueryId());
-                }
-                List<String> row = Lists.newArrayList(ProfileTreePrinter.printFragmentTree(treeRoot));
-                rows.add(row);
-                break;
-            }
-            case INSTANCES: {
-                // For query profile, there should be only one execution profile,
-                // And the execution id is same as query id
-                List<Triple<String, String, Long>> instanceList
-                        = ProfileManager.getInstance().getFragmentInstanceList(
-                        showStmt.getQueryId(), showStmt.getQueryId(), showStmt.getFragmentId());
-                if (instanceList == null) {
-                    throw new AnalysisException("Failed to get instance list for fragment: "
-                            + showStmt.getFragmentId());
-                }
-                for (Triple<String, String, Long> triple : instanceList) {
-                    List<String> row = Lists.newArrayList(triple.getLeft(), triple.getMiddle(),
-                            RuntimeProfile.printCounter(triple.getRight(), TUnit.TIME_NS));
-                    rows.add(row);
-                }
-                break;
-            }
-            case SINGLE_INSTANCE: {
-                // For query profile, there should be only one execution profile,
-                // And the execution id is same as query id
-                ProfileTreeNode treeRoot = ProfileManager.getInstance().getInstanceProfileTree(showStmt.getQueryId(),
-                        showStmt.getQueryId(), showStmt.getFragmentId(), showStmt.getInstanceId());
-                if (treeRoot == null) {
-                    throw new AnalysisException("Failed to get instance tree for instance: "
-                            + showStmt.getInstanceId());
-                }
-                List<String> row = Lists.newArrayList(ProfileTreePrinter.printInstanceTree(treeRoot));
-                rows.add(row);
-                break;
-            }
-            default:
-                break;
-        }
-
-        resultSet = new ShowResultSet(showStmt.getMetaData(), rows);
+        String selfHost = Env.getCurrentEnv().getSelfNode().getHost();
+        int httpPort = Config.http_port;
+        String terminalMsg = String.format(
+                "try visit http://%s:%d/QueryProfile, show query/load profile syntax is a deprecated feature",

Review Comment:
   how to ensure it could return a visitable url for user. for example, doris behind a net gateway, and user have no access privilege for it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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