This is an automated email from the ASF dual-hosted git repository.
starocean999 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new cdcb9786a4a [Enhancement] (nereids)implement
adminDiagnoseTabletCommand in nereids (#44744)
cdcb9786a4a is described below
commit cdcb9786a4aef1a12d8acadac2a321ef6a287032
Author: Sridhar R Manikarnike <[email protected]>
AuthorDate: Tue Dec 3 13:58:34 2024 +0530
[Enhancement] (nereids)implement adminDiagnoseTabletCommand in nereids
(#44744)
Issue Number: close #42848
---
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 | 2 +-
.../java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java | 7 +++++++
.../suites/nereids_p0/show/test_show_diagnose_tablet.groovy | 2 ++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
index eac4c661de9..b51b342e24b 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
@@ -486,6 +486,7 @@ unsupportedCancelStatement
supportedAdminStatement
: ADMIN SHOW REPLICA DISTRIBUTION FROM baseTableRef
#adminShowReplicaDistribution
+ | ADMIN DIAGNOSE TABLET tabletId=INTEGER_VALUE
#adminDiagnoseTablet
;
supportedRecoverStatement
@@ -514,7 +515,6 @@ unsupportedAdminStatement
(COMMA backends+=STRING_LITERAL) RIGHT_PAREN)?
#adminCleanTrash
| ADMIN SET TABLE name=multipartIdentifier
PARTITION VERSION properties=propertyClause?
#adminSetPartitionVersion
- | ADMIN DIAGNOSE TABLET tabletId=INTEGER_VALUE
#adminDiagnoseTablet
| ADMIN SHOW TABLET STORAGE FORMAT VERBOSE?
#adminShowTabletStorageFormat
| ADMIN COPY TABLET tabletId=INTEGER_VALUE properties=propertyClause?
#adminCopyTablet
| ADMIN SET TABLE name=multipartIdentifier STATUS
properties=propertyClause? #adminSetTableStatus
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
index 401d18775af..7804959aa79 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
@@ -50,6 +50,7 @@ import org.apache.doris.mtmv.MTMVRefreshSchedule;
import org.apache.doris.mtmv.MTMVRefreshTriggerInfo;
import org.apache.doris.nereids.DorisParser;
import org.apache.doris.nereids.DorisParser.AddConstraintContext;
+import org.apache.doris.nereids.DorisParser.AdminDiagnoseTabletContext;
import
org.apache.doris.nereids.DorisParser.AdminShowReplicaDistributionContext;
import org.apache.doris.nereids.DorisParser.AggClauseContext;
import org.apache.doris.nereids.DorisParser.AggStateDataTypeContext;
@@ -4654,6 +4655,12 @@ public class LogicalPlanBuilder extends
DorisParserBaseVisitor<Object> {
return new ShowDiagnoseTabletCommand(tabletId);
}
+ @Override
+ public LogicalPlan visitAdminDiagnoseTablet(AdminDiagnoseTabletContext
ctx) {
+ long tabletId = Long.parseLong(ctx.INTEGER_VALUE().getText());
+ return new ShowDiagnoseTabletCommand(tabletId);
+ }
+
@Override
public LogicalPlan visitShowCreateTable(ShowCreateTableContext ctx) {
List<String> nameParts = visitMultipartIdentifier(ctx.name);
diff --git
a/regression-test/suites/nereids_p0/show/test_show_diagnose_tablet.groovy
b/regression-test/suites/nereids_p0/show/test_show_diagnose_tablet.groovy
index 029fac7428e..62e008412ba 100644
--- a/regression-test/suites/nereids_p0/show/test_show_diagnose_tablet.groovy
+++ b/regression-test/suites/nereids_p0/show/test_show_diagnose_tablet.groovy
@@ -29,6 +29,8 @@ suite("test_show_diagnose_tablet_nereids", "query,diagnose") {
// Execute the SHOW TABLET DIAGNOSIS command and verify the output
checkNereidsExecute("SHOW TABLET DIAGNOSIS ${tabletId}")
+ // Execute the SHOW TABLET DIAGNOSIS command and verify the output
+ checkNereidsExecute("ADMIN DIAGNOSE TABLET ${tabletId}")
} catch (Exception e) {
log.error("Failed to execute SHOW TABLET DIAGNOSIS command", e)
throw e
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]