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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]