[Bug](Medium) ALTER STREAM SET COMMENT is not supported for table stream
Search before asking
- [x] I had searched in the issues and found no similar issues.
Version
Reproduced with the table stream regression case on local Doris HEAD d4a077caf8a.
Test environment:
regression-test/suites/table_stream_p0/test_table_stream_alter_comment.groovy
remote log: /mnt/disk1/jianxu/case_output/doris/testrun/table_stream_p0_20260708/test_table_stream_alter_comment.retry2.log
FE: 172.20.49.4:9030
What's Wrong?
ALTER STREAM ... SET COMMENT fails at parser stage, even though table stream creation with an initial comment works and information_schema.table_streams exposes the comment.
Failing SQL:
ALTER STREAM s_alter_comment SET COMMENT 'updated comment';
Actual error:
errCode = 2, detailMessage =
no viable alternative at input 'ALTER STREAM'(line 1, pos 6)
What You Expected?
ALTER STREAM ... SET COMMENT should be parsed and executed successfully, and information_schema.table_streams.STREAM_COMMENT should reflect the updated comment.
How to Reproduce?
Regression case:
regression-test/suites/table_stream_p0/test_table_stream_alter_comment.groovy
Minimal flow:
CREATE TABLE base_dup (
k1 INT,
v1 INT
)
DUPLICATE KEY(k1)
DISTRIBUTED BY HASH(k1) BUCKETS 1
PROPERTIES (
"replication_num" = "1",
"binlog.enable" = "true",
"binlog.format" = "ROW"
);
CREATE STREAM s_alter_comment ON TABLE base_dup
COMMENT 'initial comment'
PROPERTIES ("type" = "append_only");
ALTER STREAM s_alter_comment SET COMMENT 'updated comment';
Regression Test Result
suite: test_table_stream_alter_comment
command: ALTER STREAM s_alter_comment SET COMMENT 'updated comment'
actual: no viable alternative at input 'ALTER STREAM'(line 1, pos 6)
Anything Else?
Tracking issue: #65265
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Breakwater-GitHub-Analysis-Slot: slot_262e995314f2 This content is generated by AI for reference only.
Initial analysis for apache/doris#65388:
This looks like a real FE DDL support gap for table streams, not a bad test expectation. At the reported upstream commit d4a077caf8ae55e78e4fbf88da91a74facc30aed, DorisParser.g4 has CREATE STREAM ... COMMENT, DROP STREAM, SHOW STREAMS, and SHOW CREATE STREAM, but supportedAlterStatement has no ALTER STREAM alternative. Therefore ALTER STREAM s_alter_comment SET COMMENT 'updated comment' fails before analysis with the observed parser error: no viable alternative at input 'ALTER STREAM'.
The catalog side already has the data model needed for stream comments:
InternalCatalog.createTableStream()callsnewStream.setComment(createStreamInfo.getComment()).BaseTableStreamis aTableType.STREAMtable and inheritsTable.getComment()/setComment().TableStreamManager.fillTableStreamValuesMetadataResult()fillsinformation_schema.table_streams.STREAM_COMMENTfromstream.getComment().
This should not be treated as only a syntax alias to generic ALTER TABLE ... MODIFY COMMENT. The generic alter-table path is OLAP/external-table oriented: Alter.processAlterTable() handles OLAP, MATERIALIZED_VIEW, and external table types, while unhandled types fall through to Do not support alter .... A table stream is TableType.STREAM, so a maintainable fix should add stream-specific DDL plumbing instead of depending on the OLAP table comment path.
Suggested next steps:
- Add parser support for
ALTER STREAM <multipartIdentifier> SET COMMENT <STRING_LITERAL>. - Add a Nereids command for altering stream comments that validates the target is a
BaseTableStream, checksALTERprivilege on the stream object, locks the stream metadata, updatessetComment, and logs the change. - Reuse the existing table-comment edit log if possible:
ModifyCommentOperationLog.forTable(dbId, streamId, comment)plusOP_MODIFY_COMMENTreplay should work becauseAlter.replayModifyComment()resolves by db/table id and callsTable.setComment()for table comments. - Add regression coverage under
regression-test/suites/table_stream_p0for create-with-comment,ALTER STREAM ... SET COMMENT,information_schema.table_streams.STREAM_COMMENT, and preferablySHOW CREATE STREAM. If feasible, add a focused FE/replay check for edit-log persistence.
No blocking information is missing for the initial root-cause direction: the SQL, commit, and parser-stage error are enough to identify the unsupported DDL path. The remote FE log would still be useful for PR validation if the first implementation exposes a later analyzer or catalog-layer error.
Hi, I’m interested in preparing a focused fix for #65388, but before starting I’d like to confirm the intended public contract because Table Stream is still in preview and the current public documentation does not define ALTER STREAM.
Could a maintainer confirm:
- The exact syntax and name-qualification rules.
- Whether the required privilege applies to the stream, base table, or database.
- Whether the change must be edit-logged, checkpointed, replayed, and survive an FE restart.
- Whether both
SHOW CREATE STREAMandinformation_schema.table_streamsmust expose the updated comment. - Whether this must work in both on-premise and Cloud deployments, especially alongside #65859.
- Whether one PR covering parser, command, authorization, persistence, tests, and documentation is the expected scope.
I have not started implementation and will refresh overlapping PRs before doing so.
Hi, I’m interested in preparing a focused fix for #65388, but before starting I’d like to confirm the intended public contract because Table Stream is still in preview and the current public documentation does not define
ALTER STREAM.Could a maintainer confirm:
- The exact syntax and name-qualification rules.
- Whether the required privilege applies to the stream, base table, or database.
- Whether the change must be edit-logged, checkpointed, replayed, and survive an FE restart.
- Whether both
SHOW CREATE STREAMandinformation_schema.table_streamsmust expose the updated comment.- Whether this must work in both on-premise and Cloud deployments, especially alongside [feature](tablet stream) Support Cloud Table Stream control plane #65859.
- Whether one PR covering parser, command, authorization, persistence, tests, and documentation is the expected scope.
I have not started implementation and will refresh overlapping PRs before doing so.
Sorry I missed you message and already summit a PR to fix this. Please join our slack channel (https://doris.apache.org/slack) and discuss in #dev channel if you want to pick any other issue