paultanay opened a new pull request, #9881:
URL: https://github.com/apache/gravitino/pull/9881

   ## Problem
   Fixes #9694
   Users cannot clear column comments through the UI or API. When attempting to 
set a column comment to an empty value, the system throws:
   IllegalArgumentException: "newComment" field is required and cannot be empty
   
   ## Root Cause
   The `UpdateTableColumnCommentRequest.validate()` method in 
`TableUpdateRequest.java` validates that `newComment` is not blank:
   ```java
   Preconditions.checkArgument(
       StringUtils.isNotBlank(newComment),
       "\"newComment\" field is required and cannot be empty");
   This prevents users from clearing column comments.
   ```
   
   Solution
   Remove the newComment validation to align with table comment behavior.
   
   The UpdateTableCommentRequest.validate() method (line 184) already allows 
null/empty comments with no validation. Column comments should behave 
consistently.
   
   Changes
   Modified UpdateTableColumnCommentRequest.validate() in 
TableUpdateRequest.java
   Removed validation that rejects null/empty newComment values
   Added unit tests in TestTableUpdatesRequest.java for empty, null, and valid 
comments
   Added integration test in CatalogMysqlIT.java for end-to-end MySQL 
verification


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