-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Show procedures #15892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Show procedures #15892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this is your first pull request in IoTDB project. Thanks for your contribution! IoTDB will be better because of you.
This query SQL is SHOW PROCUDURES |
2. Add two more columns to the result:State、Progress
Could you please provide a screenshot with the newest columns? |
![]() |
One last thing, could you add an integration test for this? |
Hello @glutouny, glad to see this PR! I’ve just started reviewing it. So far, I feel that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL
@@ -64,7 +64,7 @@ ddlStatement | |||
| showVariables | showCluster | showRegions | showDataNodes | showConfigNodes | showClusterId | |||
| getRegionId | getTimeSlotList | countTimeSlotList | getSeriesSlotList | |||
| migrateRegion | reconstructRegion | extendRegion | removeRegion | removeDataNode | removeConfigNode | |||
| verifyConnection | |||
| verifyConnection | showProcedures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this define to line 64, stay with other SHOW statement?
Procedure<ConfigNodeProcedureEnv> procedure = procedureEntry.getValue(); | ||
procedureInfo.setProcId(procedureEntry.getKey()); | ||
procedureInfo.setStatus(procedure.getState().name()); | ||
procedureInfo.setSubmittedTime(procedure.getSubmittedTime()); | ||
procedureInfo.setLastUpdate(procedure.getLastUpdate()); | ||
procedureInfo.setParentProcId(procedure.getParentProcId()); | ||
procedureInfo.setClassName(procedure.getClass().getName()); | ||
procedureInfo.setState(procedure.getCurrentStateForDisplay()); | ||
procedureInfo.setProgress(procedure.getProgressForDisplay()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a function like toTProcedureInfo()
to Procedure.java ?
protected IConfigTask visitShowProcedures( | ||
final ShowProcedures showProceduresStatement, final MPPQueryContext context) { | ||
context.setQueryType(QueryType.READ); | ||
accessControl.checkUserIsAdmin(context.getSession().getUserName()); | ||
return new ShowProcedureTask(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other SHOW statements are generally use the MAINTAIN privilege, I suggest referring to that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides, the privilege control of new SQL needs to add IT, take a look at the function testClusterManagementSql
This PR mainly adds the Show Procedures feature: