zclllyybb commented on issue #65388:
URL: https://github.com/apache/doris/issues/65388#issuecomment-4915022064

   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()` calls 
`newStream.setComment(createStreamInfo.getComment())`.
   - `BaseTableStream` is a `TableType.STREAM` table and inherits 
`Table.getComment()/setComment()`.
   - `TableStreamManager.fillTableStreamValuesMetadataResult()` fills 
`information_schema.table_streams.STREAM_COMMENT` from `stream.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:
   
   1. Add parser support for `ALTER STREAM <multipartIdentifier> SET COMMENT 
<STRING_LITERAL>`.
   2. Add a Nereids command for altering stream comments that validates the 
target is a `BaseTableStream`, checks `ALTER` privilege on the stream object, 
locks the stream metadata, updates `setComment`, and logs the change.
   3. Reuse the existing table-comment edit log if possible: 
`ModifyCommentOperationLog.forTable(dbId, streamId, comment)` plus 
`OP_MODIFY_COMMENT` replay should work because `Alter.replayModifyComment()` 
resolves by db/table id and calls `Table.setComment()` for table comments.
   4. Add regression coverage under `regression-test/suites/table_stream_p0` 
for create-with-comment, `ALTER STREAM ... SET COMMENT`, 
`information_schema.table_streams.STREAM_COMMENT`, and preferably `SHOW 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.
   


-- 
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]

Reply via email to