Skip to content

Conversation

@ganeshashree
Copy link

What changes were proposed in this pull request?

This PR fixes a bug where COMMENT ON TABLE table_name IS NULL was not properly removing the table comment.

Why are the changes needed?

The syntax COMMENT ON TABLE table_name IS NULL should remove the table comment. However, the previous implementation was setting the comment to null rather than removing the property entirely.

Does this PR introduce any user-facing change?

How was this patch tested?

Enhanced test case test("COMMENT ON TABLE") in DataSourceV2SQLSuite verifies:

  • Comment can be set and is stored correctly
  • Comment is completely removed when set to NULL (property no longer exists)
  • Literal string "NULL" can still be set as a comment value
  • Works for both session catalog and V2 catalogs

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Sonnet 4.5

@github-actions github-actions bot added the SQL label Nov 17, 2025
@cloud-fan
Copy link
Contributor

thanks, merging to master/4.1!

@cloud-fan cloud-fan closed this in e8f0a67 Nov 18, 2025
cloud-fan pushed a commit that referenced this pull request Nov 18, 2025
…ble comment

### What changes were proposed in this pull request?

This PR fixes a bug where COMMENT ON TABLE table_name IS NULL was not properly removing the table comment.

### Why are the changes needed?

The syntax COMMENT ON TABLE table_name IS NULL should remove the table comment. However, the previous implementation was setting the comment to null rather than removing the property entirely.

### Does this PR introduce _any_ user-facing change?

### How was this patch tested?

Enhanced test case test("COMMENT ON TABLE") in DataSourceV2SQLSuite verifies:
* Comment can be set and is stored correctly
* Comment is completely removed when set to NULL (property no longer exists)
* Literal string "NULL" can still be set as a comment value
* Works for both session catalog and V2 catalogs

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Sonnet 4.5

Closes #53091 from ganeshashree/SPARK-54377.

Authored-by: Ganesha S <ganesha.s@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit e8f0a67)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants