diqiu50 opened a new issue, #14063:
URL: https://github.com/apache/gravitino/issues/14063

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   When deleting a missing column with `ifExists = true`, 
`deleteColumnFieldDefinition` returns an empty string, which is still added to 
the ALTER TABLE statement. `generateAlterTableSql` never returns an empty SQL, 
so the no-op shortcut in `JdbcTableOperations#alterTable` is never hit.
   
   - If it is the only change, ``ALTER TABLE `t` ;`` is sent. StarRocks treats 
it as a full-table OPTIMIZE job, and later schema changes are rejected until 
the job finishes.
   - Mixed with other changes, it produces a dangling comma and the alter fails.
   
   ### Error message and/or stacktrace
   
   The table t is currently in state OPTIMIZE
   
   ### How to reproduce
   
   1. Create a StarRocks table without column `missing`.
   2. Delete column `missing` with `ifExists = true`.
   3. Run `SHOW ALTER TABLE OPTIMIZE`: an OPTIMIZE job was started on the table.
   
   ### Additional context
   
   Verified on StarRocks 3.3.
   


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

Reply via email to