-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
DOCSUP-3122: Document two expressions ALTER #17059
DOCSUP-3122: Document two expressions ALTER #17059
Conversation
…o ana-uvarova-DOCSUP-3122-update-alter
…o ana-uvarova-DOCSUP-3122-update-alter
``` | ||
|
||
## REMOVE TTL {remove-ttl} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"#" missed in anchor. Should be {#remove-ttl}
@@ -122,6 +122,26 @@ Example: | |||
ALTER TABLE visits MODIFY COLUMN browser Array(String) | |||
``` | |||
|
|||
## MODIFY REMOVE | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed anchor here
@@ -110,6 +110,25 @@ MODIFY COLUMN [IF EXISTS] name [type] [default_expr] [TTL] | |||
``` sql | |||
ALTER TABLE visits MODIFY COLUMN browser Array(String) | |||
``` | |||
## MODIFY REMOVE | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed anchor here
Вы можете изменить [TTL для таблицы](../../../engines/table-engines/mergetree-family/mergetree.md#mergetree-column-ttl) запросом следующего вида: | ||
|
||
``` sql | ||
ALTER TABLE table-name MODIFY TTL ttl-expression | ||
``` | ||
|
||
## REMOVE TTL {remove-ttl} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"#" missed in anchor. Should be {#remove-ttl}
@@ -122,6 +122,26 @@ Example: | |||
ALTER TABLE visits MODIFY COLUMN browser Array(String) | |||
``` | |||
|
|||
## MODIFY REMOVE | |||
|
|||
Removes something from a column. For example, TTL-property. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes one of column properties: DEFAULT, ALIAS, MATERIALIZED, CODEC, COMMENT, TTL. We have to list all of them.
To start the background cleaning using TTL, make this: | ||
|
||
```sql | ||
OPTIMIZE TABLE table_with_ttl FINAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No table definition and now info about data. How reader can guess it?
And now we have nothing to delete. | ||
|
||
```text | ||
--2020-12-11 12:44:57 1 username1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments --
?
As a result you see that the second line was deleted. | ||
|
||
```text | ||
2020-12-11 12:44:57 1 username1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need formatted output, not tab separated.
``` | ||
|
||
And now we have nothing to delete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now TTL removed and nothing will be deleted.
|
||
Requests and results: | ||
|
||
To start the background cleaning using TTL, make this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trigger TTL forcefully with OPTIMIZE query.
@alesapin |
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category: