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-2954: Documented the view function #15881

Conversation

sevirov
Copy link
Contributor

@sevirov sevirov commented Oct 12, 2020

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

Changelog category:

Создал файл view.md и сделал описание функции view.
@robot-clickhouse robot-clickhouse added the pr-documentation Documentation PRs for the specific code PR label Oct 12, 2020
@@ -0,0 +1,61 @@
## View {#view}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## View {#view}
## view {#view}

@@ -0,0 +1,61 @@
## View {#view}

Turns an subquery into a table object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function works similarly to the view table engine. There is no much information, but it can help to make the description more informative.


**Parameters**

- `subquery` — An example: SELECT a, b, c FROM table_name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subquery can be only of the SELECT type.


**Returned value**

- A table object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Table object" is the internal term. For users it's just "A table".

└──────────┘
```

The function view helps passing queries around. For instance, it can be used in remote/cluster table functions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean "passing queries around"?

I made changes.
Changed parametrs.

**Parameters**

- `subquery` — Subquery of the `SELECT` type only.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `subquery`Subquery of the `SELECT` type only.
- `subquery``SELECT` query.

└──────────┘
```

Function `view` can be used in `remote` or `cluster` table functions:
Copy link
Contributor

@BayoNet BayoNet Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Function `view` can be used in `remote` or `cluster` table functions:
You can use the `view` function as a parameter of the `remote` and `cluster` table functions:

Copy link
Contributor

@BayoNet BayoNet Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, missing links to the remote and cluster table functions.


## view {#view}

Turns an subquery into a table. Used for implementing views (for more information, see the `CREATE VIEW query`). It does not store data, but only stores the specified `SELECT` query. When reading from a table, it runs this query (and deletes all unnecessary columns from the query).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Turns an subquery into a table. Used for implementing views (for more information, see the `CREATE VIEW query`). It does not store data, but only stores the specified `SELECT` query. When reading from a table, it runs this query (and deletes all unnecessary columns from the query).
Turns a subquery into a table. The function implements views (for more information, see the `CREATE VIEW query`). The resulting table doesn't store data, but only the specified `SELECT` query. when When reading from the table, ClickHouse executes the query and and deletes all unnecessary columns from the result.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing link to CREATE VIEW.

Changed by comments.
Перевел на русский язык.

## view {#view}

Turns a subquery into a table. The function implements views (for more information, see the [CREATE VIEW](https://clickhouse.tech/docs/en/sql-reference/statements/create/view/#create-view). The resulting table doesn't store data, but only stores the specified `SELECT` query. When reading from the table, ClickHouse executes the query and deletes all unnecessary columns from the result.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "the CREATE VIEW query" or "CREATE VIEW"
  • "For more information" is a redundant phrase with zero use. Please delete it.


**Входные параметры**

- `subquery` — `SELECT` запрос.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `subquery``SELECT` запрос.
- `subquery`запрос `SELECT`.

@BayoNet BayoNet merged commit 0a764be into ClickHouse:master Oct 19, 2020
traceon added a commit to traceon/ClickHouse that referenced this pull request Oct 19, 2020
* master: (719 commits)
  Revert "scipy"
  DOCSUP-3478: Documented the iLike function (ClickHouse#15880)
  DOCSUP-2954: Documented the view function (ClickHouse#15881)
  DOCSUP-2861: Translate on Russian (ClickHouse#16042)
  fix for floats
  tests for nullable_aggregate_states
  Update settings.md
  Update replication.md
  Update replication.md
  Update replication.md
  Update settings.md
  test for the bug 8580
  test for the bug ClickHouse#8490
  test for the bug ClickHouse#8425
  Update run.sh
  done
  remove warnings in integration tests
  reset error code in ast fuzzer
  fix segfault with wrong aggregation in lambdas
  restart the tests
  ...

# Conflicts:
#	src/Access/IAccessStorage.cpp
#	src/Access/IAccessStorage.h
#	src/Access/LDAPAccessStorage.cpp
#	src/Access/LDAPAccessStorage.h
#	src/Access/LDAPParams.h
#	src/Access/MultipleAccessStorage.cpp
#	src/Common/ErrorCodes.cpp
#	src/Server/HTTPHandler.cpp
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

3 participants