zclllyybb commented on issue #65390: URL: https://github.com/apache/doris/issues/65390#issuecomment-4915020600
Breakwater-GitHub-Analysis-Slot: slot_62432671e8cc This content is generated by AI for reference only. Initial triage: this looks like a valid FE SQL parser gap, and there is also a semantic command gap behind it. Evidence checked: - The live issue has no comments yet and reports the failure on `CANCEL ALTER STREAM s_cancel;` with `mismatched input 'STREAM' expecting 'TABLE'`. - I could not resolve the reporter's short SHA `d4a077caf8a` from the local object database or public upstream refs during triage, so I checked refreshed `upstream/master` at `a6ab604907e752d71f1359d5de9b84a7ca170a77`. - On that ref, `fe/fe-sql-parser/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4` has stream DDL entries for create/drop/show stream, but `supportedCancelStatement` only accepts `CANCEL ALTER TABLE (ROLLUP | MATERIALIZED VIEW | COLUMN) FROM ...`; there is no `CANCEL ALTER STREAM` alternative. - The builder and command path match the parser limitation: `LogicalPlanBuilder.visitCancelAlterTable()` only maps `ROLLUP`, `MATERIALIZED VIEW`, and `COLUMN`; `CancelAlterTableCommand.AlterType` only contains `COLUMN`, `ROLLUP`, and `MV`; `Env.cancelAlter()` only dispatches those table alter types to the schema-change or materialized-view handlers. - A targeted search did not find a table-stream-specific cancel-alter command or a `TableStreamManager`/catalog handler for canceling stream alter jobs on this ref. Judgment: The reported parser error is expected from the current grammar, so the issue is valid. A maintainable fix should not only add `STREAM` to the existing `CANCEL ALTER TABLE` grammar path, because the current command model cannot represent or execute stream alter cancellation. The parser, logical-plan builder, command/visitor type, privilege validation, and table-stream execution path need to agree on the intended `CANCEL ALTER STREAM` semantics. Missing information to confirm before implementing: - The intended exact syntax: for example `CANCEL ALTER STREAM <stream_name>` versus a `FROM` form, and whether job-id filtering should be supported. - Which `ALTER STREAM` operations create cancellable jobs. If some stream alterations are synchronous, the expected `no alter stream job` error should be defined as a stable semantic error for the no-active-job path. - A public branch/PR or full commit SHA for `d4a077caf8a`, if that commit contains newer table-stream DDL code not present on current public `upstream/master`. Suggested next steps: - Add a `CANCEL ALTER STREAM` parser alternative and a builder visitor that produces a stream-aware command, or extend the existing cancel command only if a real `STREAM` dispatch path is added at the same time. - Implement the semantic handler in the table-stream/catalog layer: resolve the stream name, validate the object is a table stream, check the appropriate alter privilege, locate any active alter-stream job, and return a stable "no alter stream job" style error when none exists. - Add focused coverage for parsing and execution: a parser/unit test for `CANCEL ALTER STREAM s_cancel;`, the reported regression case for the no-active-job error, and an active-job cancellation case if async alter-stream jobs exist. -- 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]
