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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org