kangpinghuang commented on a change in pull request #1687: add limit to show
tablet(#1547)
URL: https://github.com/apache/incubator-doris/pull/1687#discussion_r318357108
##########
File path: fe/src/main/java/org/apache/doris/qe/ShowExecutor.java
##########
@@ -1146,14 +1147,69 @@ private void handleShowTablet() throws
AnalysisException {
}
OlapTable olapTable = (OlapTable) table;
-
- for (Partition partition : olapTable.getPartitions()) {
+ long sizeLimit = -1;
+ if (showStmt.hasOffset() && showStmt.hasLimit()) {
+ sizeLimit = showStmt.getOffset() + showStmt.getLimit();
+ } else if (showStmt.hasLimit()) {
+ sizeLimit = showStmt.getLimit();
+ }
+ boolean stop = false;
+ Collection<Partition> partitions = new ArrayList<Partition>();
+ List<String> partitionNames = showStmt.getPartitionNames();
+ if (showStmt.hasPartition()) {
+ for (Partition partition : olapTable.getPartitions()) {
+ if (partitionNames.contains(partition.getName())) {
+ partitions.add(partition);
+ }
+ }
+ } else {
+ partitions = olapTable.getPartitions();
+ }
+ List<List<Comparable>> tableInfos = new
ArrayList<List<Comparable>>();
+ String indexName = showStmt.getIndexName();
Review comment:
ok
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]