Skip to content

Commit

Permalink
[Enhancement] (nereids)implement adminDiagnoseTabletCommand in nereids (
Browse files Browse the repository at this point in the history
apache#44744)

Issue Number: close apache#42848
  • Loading branch information
msridhar78 authored Dec 3, 2024
1 parent 0d48863 commit cdcb978
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ unsupportedCancelStatement

supportedAdminStatement
: ADMIN SHOW REPLICA DISTRIBUTION FROM baseTableRef #adminShowReplicaDistribution
| ADMIN DIAGNOSE TABLET tabletId=INTEGER_VALUE #adminDiagnoseTablet
;

supportedRecoverStatement
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
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;
Expand Down Expand Up @@ -4654,6 +4655,12 @@ public LogicalPlan visitShowDiagnoseTablet(ShowDiagnoseTabletContext ctx) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cdcb978

Please sign in to comment.