morrySnow commented on code in PR #66611:
URL: https://github.com/apache/doris/pull/66611#discussion_r3810894149


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -1938,6 +1940,17 @@ public AdminCompactTableCommand 
visitAdminCompactTable(AdminCompactTableContext
         return new AdminCompactTableCommand(tableRefInfo, equalTo);
     }
 
+    @Override
+    public AdminCompactTabletCommand 
visitAdminCompactTablet(AdminCompactTabletContext ctx) {
+        EqualTo equalTo = null;
+        if (ctx.WHERE() != null) {
+            StringLiteral left = new 
StringLiteral(stripQuotes(ctx.TYPE().getText()));

Review Comment:
   Since only the type can be specified, it is necessary to construct an 
equality expression here, but then later in the command, only the right-hand 
side value is taken and converted to an enum, which adds unnecessary complexity.



##########
fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -659,6 +659,7 @@ supportedAdminStatement
     | ADMIN DIAGNOSE TABLET tabletId=INTEGER_VALUE                             
     #adminDiagnoseTablet
     | ADMIN SHOW REPLICA STATUS FROM baseTableRef (WHERE STATUS EQ|NEQ 
STRING_LITERAL)?   #adminShowReplicaStatus
     | ADMIN COMPACT TABLE baseTableRef (WHERE TYPE EQ STRING_LITERAL)?         
     #adminCompactTable
+    | ADMIN COMPACT TABLET tabletId=INTEGER_VALUE (WHERE TYPE EQ 
STRING_LITERAL)?    #adminCompactTablet

Review Comment:
   Since "where" is required in the command, why is it made optional here?
   
   



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