Skip to content

feat(query): add new syntax to support only modify field comment #18193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Jun 19, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Support new syntax.

ALTER TABLE <TABLE_NAME> MODIFY <column name> <comment> [, COLUMN? <column_name> <comment>];

Now we can only modify field and do not assign field type.

Note: To prevent the break change, we are now compatible with both. But it will be replaced with new grammar in the future.

Link: #18181

Fix: #18154

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

TCeason added 2 commits June 19, 2025 11:24
Support new syntax:

In main:

```sql
ALTER TABLE <TABLE_NAME> MODIFY <column name> <type> [DEFAULT <expr>] [, COLUMN? <column name> <type> [DEFAULT <expr>] <comment>];
```

In pr:

```
ALTER TABLE <TABLE_NAME> MODIFY <column name> <type> [DEFAULT <expr>] [, COLUMN? <column name> <type> [DEFAULT <expr>]];
ALTER TABLE <TABLE_NAME> MODIFY <column name> <comment> [, COLUMN? <column_name> <comment>];
```
Support new syntax.

```sql
ALTER TABLE <TABLE_NAME> MODIFY <column name> <comment> [, COLUMN? <column_name> <comment>];
```

Now we can only modify field and do not assign field type.

Note: To prevent the break change, we are now compatible with both. But it will be replaced with new grammar in the future.

Link: databendlabs#18181
@TCeason TCeason marked this pull request as draft June 19, 2025 09:17
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Jun 19, 2025
@TCeason TCeason requested review from b41sh and sundy-li June 19, 2025 10:25
@TCeason TCeason marked this pull request as ready for review June 19, 2025 10:25
@TCeason TCeason requested a review from wubx June 19, 2025 10:28
@wubx
Copy link
Member

wubx commented Jun 20, 2025

LGTM

@TCeason TCeason merged commit 34ffad1 into databendlabs:main Jun 20, 2025
157 of 159 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: alter column comment maybe cause column type change.
4 participants