You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "lsy3993 (via GitHub)" <gi...@apache.org> on 2025/04/21 07:20:02 UTC

[PR] [Enhancement](nereids) support show resources [doris]

lsy3993 opened a new pull request, #50230:
URL: https://github.com/apache/doris/pull/50230

   ### What problem does this PR solve?
   
   Issue Number: close #xxx
   
   Related PR: #xxx
   
   Problem Summary:
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] Regression test
       - [x] Unit Test
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [x] Yes. <!-- Explain the behavior change -->
       'show resources' will execute by nereids
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
   
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 185007 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 2a1577c9a9a258788ec0ca13c252d8f06ab8f363, data reload: false
   
   query1	999	460	492	460
   query2	6545	1778	1771	1771
   query3	6756	223	222	222
   query4	26456	23735	23426	23426
   query5	4394	609	442	442
   query6	296	202	194	194
   query7	4624	487	299	299
   query8	313	258	240	240
   query9	8673	2567	2575	2567
   query10	507	324	262	262
   query11	15342	15010	14689	14689
   query12	157	118	101	101
   query13	1647	497	402	402
   query14	9341	6162	6129	6129
   query15	215	182	168	168
   query16	7249	634	501	501
   query17	1176	706	584	584
   query18	1962	395	294	294
   query19	188	179	162	162
   query20	118	118	119	118
   query21	206	120	117	117
   query22	4056	4089	4051	4051
   query23	33884	32801	32998	32801
   query24	8478	2342	2358	2342
   query25	528	464	385	385
   query26	1239	269	148	148
   query27	2749	485	327	327
   query28	4344	2108	2089	2089
   query29	775	560	439	439
   query30	288	214	185	185
   query31	931	860	737	737
   query32	69	64	63	63
   query33	542	377	308	308
   query34	786	850	513	513
   query35	785	808	728	728
   query36	958	970	878	878
   query37	112	106	73	73
   query38	4138	4151	4095	4095
   query39	1447	1385	1396	1385
   query40	210	122	103	103
   query41	56	55	52	52
   query42	119	100	109	100
   query43	473	495	461	461
   query44	1274	798	792	792
   query45	180	177	172	172
   query46	817	1059	611	611
   query47	1743	1806	1695	1695
   query48	367	403	291	291
   query49	743	524	433	433
   query50	638	664	391	391
   query51	4152	4152	4047	4047
   query52	111	106	99	99
   query53	223	244	184	184
   query54	561	566	509	509
   query55	85	82	89	82
   query56	297	301	273	273
   query57	1120	1116	1100	1100
   query58	263	244	242	242
   query59	2630	2718	2449	2449
   query60	312	310	298	298
   query61	128	128	128	128
   query62	798	724	660	660
   query63	218	191	178	178
   query64	4373	988	700	700
   query65	4334	4264	4235	4235
   query66	1132	406	312	312
   query67	15683	15365	15101	15101
   query68	4965	886	516	516
   query69	471	296	261	261
   query70	1188	1068	1119	1068
   query71	395	317	289	289
   query72	5522	4750	4916	4750
   query73	661	625	345	345
   query74	9134	9071	8855	8855
   query75	3165	3192	2663	2663
   query76	3206	1182	769	769
   query77	480	376	289	289
   query78	9904	10132	9234	9234
   query79	1405	820	556	556
   query80	886	529	444	444
   query81	508	247	216	216
   query82	408	127	107	107
   query83	262	255	230	230
   query84	255	94	86	86
   query85	765	348	316	316
   query86	331	313	287	287
   query87	4334	4389	4363	4363
   query88	2802	2228	2207	2207
   query89	379	311	287	287
   query90	1737	209	215	209
   query91	150	158	125	125
   query92	69	61	62	61
   query93	1100	949	585	585
   query94	690	436	311	311
   query95	390	314	302	302
   query96	486	559	285	285
   query97	3127	3224	3102	3102
   query98	240	217	211	211
   query99	1336	1411	1285	1285
   Total cold run time: 267064 ms
   Total hot run time: 185007 ms
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   run performance


-- 
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] [Enhancement](nereids) support show resources [doris]

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowResourcesCommand.java:
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.Resource;
+import org.apache.doris.catalog.ResourceMgr;
+import org.apache.doris.catalog.ScalarType;
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.CaseSensibility;
+import org.apache.doris.common.PatternMatcher;
+import org.apache.doris.common.PatternMatcherWrapper;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.util.ListComparator;
+import org.apache.doris.common.util.OrderByPair;
+import org.apache.doris.nereids.analyzer.UnboundSlot;
+import org.apache.doris.nereids.properties.OrderKey;
+import org.apache.doris.nereids.trees.expressions.CompoundPredicate;
+import org.apache.doris.nereids.trees.expressions.EqualTo;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.Like;
+import org.apache.doris.nereids.trees.expressions.Or;
+import org.apache.doris.nereids.trees.expressions.literal.StringLikeLiteral;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.ShowResultSet;
+import org.apache.doris.qe.ShowResultSetMetaData;
+import org.apache.doris.qe.StmtExecutor;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * show resources command
+ */
+public class ShowResourcesCommand extends ShowCommand {
+    private Expression wildWhere;
+    private String likePattern;
+    private List<OrderKey> orderKeys;
+    private long limit;
+    private long offset;
+    private boolean isAccurateMatch;
+    private String nameValue;
+    private String typeValue;
+    private ArrayList<OrderByPair> orderByPairs;
+
+    /**
+     * constructor for show resources
+     */
+    public ShowResourcesCommand(Expression wildWhere, String likePattern, List<OrderKey> orderKeys,
+                                    long limit, long offset) {
+        super(PlanType.SHOW_RESOURCES_COMMAND);
+        this.wildWhere = wildWhere;
+        this.likePattern = likePattern;
+        this.orderKeys = orderKeys;
+        this.limit = limit;
+        this.offset = offset;
+    }
+
+    public ShowResultSetMetaData getMetaData() {
+        ShowResultSetMetaData.Builder builder = ShowResultSetMetaData.builder();
+        for (String title : ResourceMgr.RESOURCE_PROC_NODE_TITLE_NAMES) {
+            builder.addColumn(new Column(title, ScalarType.createVarchar(30)));
+        }
+        return builder.build();
+    }
+
+    public boolean isAccurateMatch() {
+        return this.isAccurateMatch;
+    }
+
+    public ArrayList<OrderByPair> getOrderByPairs() {
+        return this.orderByPairs;
+    }
+
+    /**
+     * handle show resources
+     */
+    private ShowResultSet handleShowResources(ConnectContext ctx, StmtExecutor executor) throws Exception {
+        // first validate the auth and where
+        validate(ctx);
+
+        // then process the order by
+        orderByPairs = processOrderBy();
+
+        PatternMatcher matcher = null;
+        if (likePattern != null) {
+            matcher = PatternMatcherWrapper.createMysqlPattern(likePattern,
+                    CaseSensibility.RESOURCE.getCaseSensibility());
+        }
+
+        // sort the result
+        List<List<Comparable>> resourcesInfos = Env.getCurrentEnv().getResourceMgr()
+                .getResourcesInfo(matcher, nameValue, isAccurateMatch, getTypeSet());
+        ListComparator<List<Comparable>> comparator = null;
+        if (orderByPairs != null) {
+            OrderByPair[] orderByPairArr = new OrderByPair[orderByPairs.size()];
+            comparator = new ListComparator<List<Comparable>>(orderByPairs.toArray(orderByPairArr));
+        } else {
+            // sort by name asc
+            comparator = new ListComparator<List<Comparable>>(0);
+        }
+        Collections.sort(resourcesInfos, comparator);
+
+        List<List<String>> rows = Lists.newArrayList();
+        for (List<Comparable> resourceInfo : resourcesInfos) {
+            List<String> oneResource = new ArrayList<String>(resourceInfo.size());
+
+            for (Comparable element : resourceInfo) {
+                oneResource.add(element.toString());
+            }
+            rows.add(oneResource);
+        }
+
+        // limit and offset
+        if (offset >= rows.size()) {
+            rows = Lists.newArrayList();
+        } else if (limit != -1L) {
+            if ((limit + offset) < rows.size()) {
+                rows = rows.subList((int) offset, (int) (limit + offset));
+            } else {
+                rows = rows.subList((int) offset, rows.size());
+            }
+        }
+
+        // Only success
+        return new ShowResultSet(getMetaData(), rows);
+    }
+
+    /**
+     * validate the auth and where
+     */
+    @VisibleForTesting
+    protected boolean validate(ConnectContext ctx) throws UserException {
+        boolean isValid = true;
+        if (this.likePattern == null) {
+            if (wildWhere instanceof CompoundPredicate) {
+                if (wildWhere instanceof Or) {
+                    throw new AnalysisException("Only allow compound predicate with operator AND");
+                }
+                isValid = isWhereClauseValid(wildWhere.child(0)) && isWhereClauseValid(wildWhere.child(1));
+            } else {
+                isValid = isWhereClauseValid(wildWhere);
+            }
+
+            if (!isValid) {
+                throw new AnalysisException("Where clause should looks like: NAME = \"your_resource_name\","
+                    + " or NAME LIKE \"matcher\", " + " or RESOURCETYPE = \"resource_type\", "
+                    + " or compound predicate with operator AND");
+            }
+        }
+
+        return true;
+    }
+
+    @VisibleForTesting
+    protected ArrayList<OrderByPair> processOrderBy() throws AnalysisException {
+        if (orderKeys != null && !orderKeys.isEmpty()) {
+            orderByPairs = new ArrayList<>();
+            for (OrderKey orderKey : orderKeys) {
+                if (!(orderKey.getExpr() instanceof UnboundSlot)) {
+                    throw new AnalysisException("Should order by column");
+                }
+
+                UnboundSlot slot = (UnboundSlot) orderKey.getExpr();
+                if (slot != null) {
+                    String colName = slot.getName();
+                    int index = ResourceMgr.analyzeColumn(colName);
+                    OrderByPair orderByPair = new OrderByPair(index, !orderKey.isAsc());
+                    orderByPairs.add(orderByPair);
+                }
+            }
+        }
+
+        return orderByPairs;
+    }
+
+    private Set<String> getTypeSet() {
+        if (Strings.isNullOrEmpty(typeValue)) {
+            return null;
+        }
+        Set<String> resources = new HashSet<>();
+        resources.add(typeValue.toUpperCase());
+        return resources;
+    }
+
+    private boolean isWhereClauseValid(Expression expr) {
+        if (expr == null) {
+            return true;
+        }
+
+        if (!(expr instanceof EqualTo) && !(expr instanceof Like)) {
+            return false;
+        }
+
+        // left child
+        if (!(expr.child(0) instanceof UnboundSlot)) {
+            return false;
+        }
+        String leftKey = ((UnboundSlot) expr.child(0)).getName();
+        // right child
+        if (!(expr.child(1) instanceof StringLikeLiteral)) {
+            return false;
+        }
+        String rightValue = ((StringLikeLiteral) expr.child(1)).getStringValue();
+        if (Strings.isNullOrEmpty(rightValue)) {
+            return false;
+        }
+
+        if (leftKey.equalsIgnoreCase("Name")) {
+            if (expr instanceof EqualTo) {
+                isAccurateMatch = true;
+            }
+            nameValue = rightValue;
+            return true;
+        }
+
+        if (leftKey.equalsIgnoreCase("ResourceType") && expr instanceof EqualTo) {
+            typeValue = rightValue.toUpperCase();
+            try {
+                Resource.ResourceType.valueOf(typeValue);
+            } catch (Exception e) {
+                return false;
+            }
+            return true;
+        }
+
+        return false;
+    }
+

Review Comment:
   need rewrite toRedirectStatus method like old planner:
   ```
       @Override
       public RedirectStatus getRedirectStatus() {
           if (ConnectContext.get().getSessionVariable().getForwardToMaster()) {
               return RedirectStatus.FORWARD_NO_SYNC;
           } else {
               return RedirectStatus.NO_FORWARD;
           }
       }
   ```



-- 
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] [Enhancement](nereids) support show resources [doris]

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowResourcesCommand.java:
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.Resource;
+import org.apache.doris.catalog.ResourceMgr;
+import org.apache.doris.catalog.ScalarType;
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.CaseSensibility;
+import org.apache.doris.common.PatternMatcher;
+import org.apache.doris.common.PatternMatcherWrapper;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.util.ListComparator;
+import org.apache.doris.common.util.OrderByPair;
+import org.apache.doris.nereids.analyzer.UnboundSlot;
+import org.apache.doris.nereids.properties.OrderKey;
+import org.apache.doris.nereids.trees.expressions.CompoundPredicate;
+import org.apache.doris.nereids.trees.expressions.EqualTo;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.Like;
+import org.apache.doris.nereids.trees.expressions.Or;
+import org.apache.doris.nereids.trees.expressions.literal.StringLikeLiteral;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.ShowResultSet;
+import org.apache.doris.qe.ShowResultSetMetaData;
+import org.apache.doris.qe.StmtExecutor;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * show resources command
+ */
+public class ShowResourcesCommand extends ShowCommand {
+    private Expression wildWhere;

Review Comment:
   these can be final:
   ```
       private Expression wildWhere;
       private String likePattern;
       private List<OrderKey> orderKeys;
       private long limit;
       private long offset;
   ```



-- 
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] [Enhancement](nereids) support show resources [doris]

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

   run feut


-- 
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] [Enhancement](nereids) support show resources [doris]

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


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 33510 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit eccfc6617ab8b1d14518fc8bedfef49e63946b34, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	25709	5032	4963	4963
   q2	2062	272	189	189
   q3	10400	1241	685	685
   q4	10230	992	545	545
   q5	8002	2339	2306	2306
   q6	181	159	132	132
   q7	902	736	624	624
   q8	9312	1251	1045	1045
   q9	6778	5111	5059	5059
   q10	6850	2291	1896	1896
   q11	490	295	256	256
   q12	341	342	212	212
   q13	17778	3660	3057	3057
   q14	227	220	202	202
   q15	535	469	482	469
   q16	434	451	394	394
   q17	583	842	362	362
   q18	7425	7108	7059	7059
   q19	1227	947	526	526
   q20	329	329	224	224
   q21	3967	2616	2387	2387
   q22	1071	999	918	918
   Total cold run time: 114833 ms
   Total hot run time: 33510 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	5059	5012	5022	5012
   q2	236	325	232	232
   q3	2159	2604	2262	2262
   q4	1387	1776	1369	1369
   q5	4312	4358	4399	4358
   q6	211	170	124	124
   q7	1974	1958	1728	1728
   q8	2560	2523	2512	2512
   q9	7231	7195	7056	7056
   q10	3034	3158	2713	2713
   q11	581	505	495	495
   q12	680	749	632	632
   q13	3549	3910	3299	3299
   q14	301	290	260	260
   q15	523	499	478	478
   q16	507	498	454	454
   q17	1140	1457	1390	1390
   q18	7668	7626	7386	7386
   q19	791	842	904	842
   q20	1955	2019	1866	1866
   q21	5124	4841	4764	4764
   q22	1121	1070	1011	1011
   Total cold run time: 52103 ms
   Total hot run time: 50243 ms
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 33848 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 2a1577c9a9a258788ec0ca13c252d8f06ab8f363, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	26095	5104	5024	5024
   q2	2059	276	186	186
   q3	10395	1248	730	730
   q4	10235	1039	533	533
   q5	7564	2333	2393	2333
   q6	182	166	132	132
   q7	920	746	610	610
   q8	9335	1303	1033	1033
   q9	6889	5102	5017	5017
   q10	6817	2308	1879	1879
   q11	476	283	266	266
   q12	337	345	215	215
   q13	17751	3677	3096	3096
   q14	219	222	226	222
   q15	535	487	489	487
   q16	443	444	403	403
   q17	573	856	354	354
   q18	7532	7196	7123	7123
   q19	1071	931	546	546
   q20	328	330	224	224
   q21	4147	3346	2435	2435
   q22	1089	1025	1000	1000
   Total cold run time: 114992 ms
   Total hot run time: 33848 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	5119	5073	5088	5073
   q2	240	327	231	231
   q3	2169	2680	2308	2308
   q4	1384	1841	1408	1408
   q5	4530	4459	4424	4424
   q6	213	162	123	123
   q7	1986	1853	1721	1721
   q8	2540	2557	2517	2517
   q9	7074	7105	7133	7105
   q10	2984	3155	2755	2755
   q11	565	489	482	482
   q12	665	792	593	593
   q13	3426	3825	3301	3301
   q14	293	295	280	280
   q15	525	472	476	472
   q16	488	517	455	455
   q17	1129	1462	1414	1414
   q18	7826	7518	7524	7518
   q19	778	792	890	792
   q20	1956	2026	1910	1910
   q21	5410	4645	4649	4645
   q22	1127	1058	1019	1019
   Total cold run time: 52427 ms
   Total hot run time: 50546 ms
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   run performance


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 29.66 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit 2a1577c9a9a258788ec0ca13c252d8f06ab8f363, data reload: false
   
   query1	0.03	0.03	0.04
   query2	0.12	0.11	0.11
   query3	0.24	0.20	0.19
   query4	1.59	0.20	0.19
   query5	0.58	0.58	0.58
   query6	1.18	0.71	0.70
   query7	0.02	0.01	0.01
   query8	0.04	0.04	0.03
   query9	0.58	0.51	0.51
   query10	0.58	0.57	0.57
   query11	0.16	0.11	0.10
   query12	0.14	0.12	0.12
   query13	0.60	0.59	0.59
   query14	1.19	1.15	1.21
   query15	0.88	0.85	0.84
   query16	0.39	0.38	0.37
   query17	1.01	1.02	1.03
   query18	0.21	0.19	0.20
   query19	1.90	1.83	1.78
   query20	0.01	0.01	0.02
   query21	15.41	0.90	0.56
   query22	0.75	1.10	0.74
   query23	14.98	1.39	0.63
   query24	6.78	0.92	1.28
   query25	0.47	0.28	0.07
   query26	0.62	0.16	0.15
   query27	0.05	0.05	0.06
   query28	9.66	0.90	0.42
   query29	12.56	3.92	3.30
   query30	0.25	0.09	0.06
   query31	2.85	0.58	0.38
   query32	3.21	0.54	0.48
   query33	3.03	2.99	3.10
   query34	15.64	5.13	4.49
   query35	4.51	4.58	4.55
   query36	0.67	0.51	0.47
   query37	0.09	0.07	0.06
   query38	0.05	0.04	0.03
   query39	0.03	0.02	0.03
   query40	0.18	0.14	0.13
   query41	0.08	0.03	0.02
   query42	0.03	0.02	0.02
   query43	0.04	0.04	0.03
   Total cold run time: 103.39 s
   Total hot run time: 29.66 s
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>TPC-H: <b>Total hot run time: 34127 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
   Tpch sf100 test result on commit 3ff4598fcfa8d708943f9e02f94a3054b6482099, data reload: false
   
   ------ Round 1 ----------------------------------
   q1	26183	5050	5013	5013
   q2	2064	273	177	177
   q3	10995	1259	673	673
   q4	10969	1017	552	552
   q5	7574	2334	2328	2328
   q6	194	168	131	131
   q7	905	754	601	601
   q8	9309	1276	1027	1027
   q9	7010	5285	5283	5283
   q10	6961	2362	1939	1939
   q11	483	295	272	272
   q12	354	366	232	232
   q13	20411	3704	3151	3151
   q14	238	247	214	214
   q15	639	488	488	488
   q16	476	452	403	403
   q17	767	849	372	372
   q18	8203	7107	7155	7107
   q19	2272	967	533	533
   q20	323	339	217	217
   q21	3817	3366	2426	2426
   q22	1074	1020	988	988
   Total cold run time: 121221 ms
   Total hot run time: 34127 ms
   
   ----- Round 2, with runtime_filter_mode=off -----
   q1	5156	5050	5053	5050
   q2	248	322	235	235
   q3	2151	2630	2362	2362
   q4	1501	1905	1461	1461
   q5	4518	4437	4378	4378
   q6	220	171	132	132
   q7	1977	1909	1737	1737
   q8	2607	2617	2526	2526
   q9	7200	7138	7088	7088
   q10	2925	3155	2716	2716
   q11	569	507	488	488
   q12	707	733	604	604
   q13	3552	3938	3259	3259
   q14	275	285	282	282
   q15	512	482	481	481
   q16	483	525	482	482
   q17	1137	1561	1377	1377
   q18	7770	7548	7420	7420
   q19	769	777	889	777
   q20	1984	2047	1870	1870
   q21	5337	4892	4791	4791
   q22	1153	1067	1040	1040
   Total cold run time: 52751 ms
   Total hot run time: 50556 ms
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 192207 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit 3ff4598fcfa8d708943f9e02f94a3054b6482099, data reload: false
   
   query1	1413	1092	1052	1052
   query2	6090	1785	1781	1781
   query3	11178	4676	4604	4604
   query4	51942	25286	23265	23265
   query5	5170	545	453	453
   query6	342	203	190	190
   query7	4902	500	273	273
   query8	306	274	230	230
   query9	5784	2529	2569	2529
   query10	419	340	264	264
   query11	15023	15015	14806	14806
   query12	151	107	99	99
   query13	1024	494	390	390
   query14	9977	6282	6397	6282
   query15	202	188	180	180
   query16	7001	691	504	504
   query17	1090	729	592	592
   query18	1519	417	310	310
   query19	198	185	154	154
   query20	119	130	123	123
   query21	207	132	107	107
   query22	4329	4510	4356	4356
   query23	34052	33470	33338	33338
   query24	6492	2431	2507	2431
   query25	452	474	407	407
   query26	637	264	154	154
   query27	2176	495	328	328
   query28	3098	2164	2143	2143
   query29	569	561	428	428
   query30	268	221	193	193
   query31	851	842	774	774
   query32	71	58	65	58
   query33	451	378	319	319
   query34	769	849	533	533
   query35	786	857	739	739
   query36	921	1028	894	894
   query37	116	99	73	73
   query38	4166	4239	4221	4221
   query39	1486	1428	1464	1428
   query40	205	122	114	114
   query41	53	55	52	52
   query42	114	107	105	105
   query43	494	512	471	471
   query44	1292	797	805	797
   query45	178	168	167	167
   query46	847	1025	650	650
   query47	1844	1864	1819	1819
   query48	393	431	314	314
   query49	681	544	433	433
   query50	680	694	394	394
   query51	4219	4320	4145	4145
   query52	116	111	98	98
   query53	219	270	185	185
   query54	580	563	524	524
   query55	85	78	83	78
   query56	291	302	297	297
   query57	1158	1184	1118	1118
   query58	261	269	245	245
   query59	2677	2779	2651	2651
   query60	338	326	308	308
   query61	134	135	133	133
   query62	784	726	698	698
   query63	227	197	195	195
   query64	1442	1022	737	737
   query65	4441	4371	4235	4235
   query66	737	391	295	295
   query67	15742	15494	15248	15248
   query68	5418	882	540	540
   query69	503	326	268	268
   query70	1199	1139	1089	1089
   query71	445	315	284	284
   query72	5988	4867	5076	4867
   query73	1133	699	339	339
   query74	8882	9200	8750	8750
   query75	3267	3189	2725	2725
   query76	3807	1178	748	748
   query77	554	361	296	296
   query78	10118	9913	9306	9306
   query79	2709	809	586	586
   query80	703	525	532	525
   query81	470	260	211	211
   query82	636	126	99	99
   query83	249	244	230	230
   query84	297	101	84	84
   query85	794	360	323	323
   query86	386	298	281	281
   query87	4338	4414	4313	4313
   query88	3473	2208	2194	2194
   query89	420	314	357	314
   query90	1748	204	207	204
   query91	142	145	109	109
   query92	72	60	61	60
   query93	2530	933	581	581
   query94	734	405	269	269
   query95	371	292	284	284
   query96	491	558	269	269
   query97	3178	3222	3067	3067
   query98	231	208	192	192
   query99	1710	1378	1289	1289
   Total cold run time: 292975 ms
   Total hot run time: 192207 ms
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 29.13 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit 3ff4598fcfa8d708943f9e02f94a3054b6482099, data reload: false
   
   query1	0.03	0.03	0.03
   query2	0.11	0.11	0.12
   query3	0.27	0.19	0.19
   query4	1.59	0.19	0.19
   query5	0.58	0.59	0.61
   query6	1.18	0.71	0.73
   query7	0.03	0.01	0.02
   query8	0.04	0.04	0.03
   query9	0.57	0.54	0.51
   query10	0.56	0.57	0.56
   query11	0.15	0.10	0.11
   query12	0.14	0.11	0.11
   query13	0.62	0.59	0.60
   query14	1.22	1.19	1.16
   query15	0.88	0.86	0.87
   query16	0.39	0.42	0.37
   query17	1.03	1.02	1.04
   query18	0.22	0.20	0.20
   query19	1.85	1.73	1.81
   query20	0.02	0.01	0.01
   query21	15.42	0.90	0.58
   query22	0.74	1.07	0.61
   query23	15.10	1.38	0.64
   query24	7.34	0.94	0.45
   query25	0.46	0.14	0.11
   query26	0.61	0.16	0.14
   query27	0.06	0.05	0.05
   query28	8.78	0.84	0.44
   query29	12.63	3.94	3.32
   query30	0.25	0.09	0.07
   query31	2.81	0.60	0.38
   query32	3.23	0.55	0.47
   query33	2.99	3.19	2.98
   query34	15.79	5.11	4.48
   query35	4.55	4.54	4.53
   query36	0.67	0.51	0.48
   query37	0.08	0.06	0.06
   query38	0.05	0.04	0.04
   query39	0.03	0.02	0.02
   query40	0.17	0.13	0.12
   query41	0.08	0.03	0.03
   query42	0.04	0.02	0.02
   query43	0.04	0.03	0.03
   Total cold run time: 103.4 s
   Total hot run time: 29.13 s
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>ClickBench: <b>Total hot run time: 29.61 s</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
   ClickBench test result on commit eccfc6617ab8b1d14518fc8bedfef49e63946b34, data reload: false
   
   query1	0.03	0.03	0.03
   query2	0.13	0.11	0.11
   query3	0.24	0.19	0.19
   query4	1.58	0.20	0.19
   query5	0.59	0.57	0.58
   query6	1.20	0.72	0.72
   query7	0.02	0.02	0.01
   query8	0.04	0.04	0.03
   query9	0.58	0.52	0.51
   query10	0.58	0.58	0.58
   query11	0.15	0.11	0.11
   query12	0.15	0.12	0.12
   query13	0.61	0.60	0.59
   query14	1.15	1.18	1.18
   query15	0.87	0.85	0.86
   query16	0.40	0.37	0.37
   query17	1.02	1.04	1.01
   query18	0.20	0.19	0.20
   query19	1.88	1.73	1.85
   query20	0.02	0.01	0.01
   query21	15.41	0.88	0.54
   query22	0.75	1.22	0.79
   query23	14.77	1.37	0.63
   query24	7.05	1.70	0.76
   query25	0.51	0.12	0.10
   query26	0.63	0.16	0.13
   query27	0.06	0.05	0.05
   query28	9.74	0.82	0.43
   query29	12.60	3.97	3.31
   query30	0.25	0.10	0.07
   query31	2.82	0.57	0.40
   query32	3.24	0.54	0.47
   query33	3.07	3.05	3.06
   query34	15.86	5.07	4.46
   query35	4.55	4.52	4.54
   query36	0.66	0.49	0.48
   query37	0.09	0.07	0.06
   query38	0.05	0.04	0.04
   query39	0.04	0.02	0.02
   query40	0.17	0.13	0.13
   query41	0.08	0.02	0.02
   query42	0.03	0.02	0.03
   query43	0.04	0.03	0.03
   Total cold run time: 103.91 s
   Total hot run time: 29.61 s
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowResourcesCommand.java:
##########
@@ -0,0 +1,264 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.trees.plans.commands;
+
+import org.apache.doris.catalog.Column;
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.Resource;
+import org.apache.doris.catalog.ResourceMgr;
+import org.apache.doris.catalog.ScalarType;
+import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.CaseSensibility;
+import org.apache.doris.common.PatternMatcher;
+import org.apache.doris.common.PatternMatcherWrapper;
+import org.apache.doris.common.UserException;
+import org.apache.doris.common.util.ListComparator;
+import org.apache.doris.common.util.OrderByPair;
+import org.apache.doris.nereids.analyzer.UnboundSlot;
+import org.apache.doris.nereids.properties.OrderKey;
+import org.apache.doris.nereids.trees.expressions.CompoundPredicate;
+import org.apache.doris.nereids.trees.expressions.EqualTo;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.expressions.Like;
+import org.apache.doris.nereids.trees.expressions.Or;
+import org.apache.doris.nereids.trees.expressions.literal.StringLikeLiteral;
+import org.apache.doris.nereids.trees.plans.PlanType;
+import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.qe.ShowResultSet;
+import org.apache.doris.qe.ShowResultSetMetaData;
+import org.apache.doris.qe.StmtExecutor;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * show resources command
+ */
+public class ShowResourcesCommand extends ShowCommand {
+    private Expression wildWhere;
+    private String likePattern;
+    private List<OrderKey> orderKeys;
+    private long limit;
+    private long offset;
+    private boolean isAccurateMatch;
+    private String nameValue;
+    private String typeValue;
+    private ArrayList<OrderByPair> orderByPairs;
+
+    /**
+     * constructor for show resources
+     */
+    public ShowResourcesCommand(Expression wildWhere, String likePattern, List<OrderKey> orderKeys,
+                                    long limit, long offset) {
+        super(PlanType.SHOW_RESOURCES_COMMAND);
+        this.wildWhere = wildWhere;
+        this.likePattern = likePattern;
+        this.orderKeys = orderKeys;
+        this.limit = limit;
+        this.offset = offset;
+    }
+
+    public ShowResultSetMetaData getMetaData() {
+        ShowResultSetMetaData.Builder builder = ShowResultSetMetaData.builder();
+        for (String title : ResourceMgr.RESOURCE_PROC_NODE_TITLE_NAMES) {
+            builder.addColumn(new Column(title, ScalarType.createVarchar(30)));
+        }
+        return builder.build();
+    }
+
+    public boolean isAccurateMatch() {
+        return this.isAccurateMatch;
+    }
+
+    public ArrayList<OrderByPair> getOrderByPairs() {
+        return this.orderByPairs;
+    }
+
+    /**
+     * handle show resources
+     */
+    private ShowResultSet handleShowResources(ConnectContext ctx, StmtExecutor executor) throws Exception {
+        // first validate the auth and where
+        validate(ctx);
+
+        // then process the order by
+        orderByPairs = processOrderBy();
+
+        PatternMatcher matcher = null;
+        if (likePattern != null) {
+            matcher = PatternMatcherWrapper.createMysqlPattern(likePattern,
+                    CaseSensibility.RESOURCE.getCaseSensibility());
+        }
+
+        // sort the result
+        List<List<Comparable>> resourcesInfos = Env.getCurrentEnv().getResourceMgr()
+                .getResourcesInfo(matcher, nameValue, isAccurateMatch, getTypeSet());
+        ListComparator<List<Comparable>> comparator = null;
+        if (orderByPairs != null) {
+            OrderByPair[] orderByPairArr = new OrderByPair[orderByPairs.size()];
+            comparator = new ListComparator<List<Comparable>>(orderByPairs.toArray(orderByPairArr));
+        } else {
+            // sort by name asc
+            comparator = new ListComparator<List<Comparable>>(0);
+        }
+        Collections.sort(resourcesInfos, comparator);
+
+        List<List<String>> rows = Lists.newArrayList();
+        for (List<Comparable> resourceInfo : resourcesInfos) {
+            List<String> oneResource = new ArrayList<String>(resourceInfo.size());
+
+            for (Comparable element : resourceInfo) {
+                oneResource.add(element.toString());
+            }
+            rows.add(oneResource);
+        }
+
+        // limit and offset
+        if (offset >= rows.size()) {
+            rows = Lists.newArrayList();
+        } else if (limit != -1L) {
+            if ((limit + offset) < rows.size()) {
+                rows = rows.subList((int) offset, (int) (limit + offset));
+            } else {
+                rows = rows.subList((int) offset, rows.size());
+            }
+        }
+
+        // Only success
+        return new ShowResultSet(getMetaData(), rows);
+    }
+
+    /**
+     * validate the auth and where
+     */
+    @VisibleForTesting
+    protected boolean validate(ConnectContext ctx) throws UserException {
+        boolean isValid = true;
+        if (this.likePattern == null) {
+            if (wildWhere instanceof CompoundPredicate) {
+                if (wildWhere instanceof Or) {

Review Comment:
   ```suggestion
                   if (!(wildWhere instanceof And)) {
   ```
   although there are only 'or' and 'and' CompoundPredicate, what if we add some other CompoundPredicate in future? So better to only allow 'and'



-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   <details>
   <summary>TPC-DS: <b>Total hot run time: 191870 ms</b></summary>
   
   ```
   machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
   TPC-DS sf100 test result on commit eccfc6617ab8b1d14518fc8bedfef49e63946b34, data reload: false
   
   query1	1384	1097	1106	1097
   query2	6148	1846	1878	1846
   query3	11029	4451	4766	4451
   query4	25621	23750	23059	23059
   query5	4398	622	459	459
   query6	313	224	204	204
   query7	3991	493	289	289
   query8	312	268	240	240
   query9	8534	2563	2578	2563
   query10	482	325	266	266
   query11	15172	15056	14766	14766
   query12	172	112	111	111
   query13	1557	532	405	405
   query14	9157	6245	6195	6195
   query15	191	183	170	170
   query16	7607	605	499	499
   query17	1210	748	627	627
   query18	2042	432	327	327
   query19	207	189	194	189
   query20	128	128	122	122
   query21	206	131	111	111
   query22	4350	4464	4203	4203
   query23	34162	33472	33720	33472
   query24	8554	2462	2478	2462
   query25	516	473	394	394
   query26	1201	272	149	149
   query27	2693	512	356	356
   query28	4637	2210	2140	2140
   query29	693	557	438	438
   query30	270	219	197	197
   query31	896	850	777	777
   query32	72	62	68	62
   query33	555	371	303	303
   query34	814	861	511	511
   query35	825	856	756	756
   query36	998	982	926	926
   query37	111	98	76	76
   query38	4219	4156	4160	4156
   query39	1651	1415	1427	1415
   query40	222	115	113	113
   query41	55	53	52	52
   query42	125	109	109	109
   query43	491	528	486	486
   query44	1361	822	812	812
   query45	192	180	180	180
   query46	875	1034	662	662
   query47	1816	1845	1755	1755
   query48	381	423	319	319
   query49	795	520	428	428
   query50	673	713	426	426
   query51	4203	4133	4190	4133
   query52	107	123	113	113
   query53	249	262	184	184
   query54	596	618	521	521
   query55	86	87	85	85
   query56	326	321	303	303
   query57	1171	1184	1093	1093
   query58	261	271	248	248
   query59	2793	2777	2595	2595
   query60	328	329	308	308
   query61	126	127	129	127
   query62	756	754	679	679
   query63	227	186	193	186
   query64	4241	1053	749	749
   query65	4504	4312	4349	4312
   query66	994	403	309	309
   query67	16190	15529	15333	15333
   query68	8361	909	527	527
   query69	471	303	270	270
   query70	1207	1071	1105	1071
   query71	470	335	296	296
   query72	5579	4809	4859	4809
   query73	738	683	354	354
   query74	8912	9243	8654	8654
   query75	3860	3204	2684	2684
   query76	3757	1193	781	781
   query77	776	384	290	290
   query78	10001	10134	9243	9243
   query79	2190	812	560	560
   query80	680	507	435	435
   query81	476	256	219	219
   query82	448	122	95	95
   query83	281	252	232	232
   query84	294	109	84	84
   query85	771	423	314	314
   query86	376	321	307	307
   query87	4418	4383	4343	4343
   query88	3473	2185	2201	2185
   query89	387	306	287	287
   query90	1911	215	206	206
   query91	160	139	117	117
   query92	81	57	56	56
   query93	1724	954	581	581
   query94	650	420	296	296
   query95	374	290	287	287
   query96	497	554	272	272
   query97	3165	3198	3131	3131
   query98	299	202	193	193
   query99	1429	1412	1282	1282
   Total cold run time: 279438 ms
   Total hot run time: 191870 ms
   ```
   </details>
   


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   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] [Enhancement](nereids) support show resources [doris]

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

   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] [Enhancement](nereids) support show resources [doris]

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

   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] [Enhancement](nereids) support show resources [doris]

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

   run cloud_p0


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   run feut


-- 
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] [Enhancement](nereids) support show resources [doris]

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

   
   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).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
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