SudharsanK2308 commented on code in PR #66116:
URL: https://github.com/apache/doris/pull/66116#discussion_r3663213728


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowTabletsFromTableCommand.java:
##########
@@ -225,44 +225,30 @@ public ShowResultSet doRun(ConnectContext ctx, 
StmtExecutor executor) throws Exc
             }
             List<List<Comparable>> tabletInfos = new ArrayList<>();
             for (Partition partition : partitions) {
-                if (stop) {
-                    break;
-                }
                 for (MaterializedIndex index : 
partition.getMaterializedIndices(IndexExtState.ALL)) {
                     TabletsProcDir procDir = new TabletsProcDir(olapTable, 
index);
                     tabletInfos.addAll(procDir.fetchComparableResult(
                             version, backendId, replicaState));
-                    if (sizeLimit > -1 && tabletInfos.size() >= sizeLimit) {
-                        stop = true;
-                        break;
-                    }
                 }
             }
-            if (offset >= tabletInfos.size()) {
-                tabletInfos.clear();
+            // order by
+            ListComparator<List<Comparable>> comparator;
+            if (orderByPairs != null) {
+                OrderByPair[] orderByPairArr = new 
OrderByPair[orderByPairs.size()];
+                comparator = new 
ListComparator<>(orderByPairs.toArray(orderByPairArr));
             } else {
-                // order by
-                ListComparator<List<Comparable>> comparator = null;
-                if (orderByPairs != null) {
-                    OrderByPair[] orderByPairArr = new 
OrderByPair[orderByPairs.size()];
-                    comparator = new 
ListComparator<>(orderByPairs.toArray(orderByPairArr));
-                } else {
-                    // order by tabletId, replicaId
-                    comparator = new ListComparator<>(0, 1);
-                }
-                Collections.sort(tabletInfos, comparator);
-                if (sizeLimit > -1) {
-                    tabletInfos = tabletInfos.subList((int) offset,

Review Comment:
   Narrowing Type Casting in the existing version



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

Reply via email to