Skip to content
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

Merged

Conversation

AnaUvarova
Copy link
Contributor

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category:

@robot-clickhouse robot-clickhouse added the pr-documentation Documentation PRs for the specific code PR label Nov 16, 2020
@AnaUvarova AnaUvarova changed the title [In progress] DOCSUP-3122: Document two expression ALTER DOCSUP-3122: Document two expression ALTER Dec 14, 2020
@AnaUvarova AnaUvarova changed the title DOCSUP-3122: Document two expression ALTER DOCSUP-3122: Document two expressions ALTER Dec 17, 2020
```

## REMOVE TTL {remove-ttl}

Copy link
Contributor

@olgarev olgarev Dec 18, 2020

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

Copy link
Contributor

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

Copy link
Contributor

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}

Copy link
Contributor

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.
Copy link
Member

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;
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

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:
Copy link
Member

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 alesapin self-assigned this Dec 22, 2020
@AnaUvarova
Copy link
Contributor Author

@alesapin
Hello, Alexander, please take a look.

@alesapin alesapin merged commit 163be41 into ClickHouse:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-documentation Documentation PRs for the specific code PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants