From 1d9d1e256f730ab26d63cc8463bb8df9ea9a9178 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Tue, 2 Jun 2020 08:10:59 +0300 Subject: [PATCH] DOCS-573: system.data_type_families (#11344) * DOCSUP-921 (#113) * add the description of data_type_families system table * add related link, change output example, correct columns description * fix typos add links * add russian description of data_type_families system table * fix links to data_type_families system table Co-authored-by: Sergei Shtykov * CLICKHOUSEDOCS-573: system.data_type_families * CLICKHOUSEDOCS-573: Corrected the wording. Co-authored-by: pewit-nk <62423826+pewit-nk@users.noreply.github.com> Co-authored-by: Sergei Shtykov --- docs/en/operations/system-tables.md | 35 +++++++++++++++++++++++ docs/en/sql-reference/data-types/index.md | 2 ++ docs/en/sql-reference/syntax.md | 2 +- docs/ru/operations/system-tables.md | 35 +++++++++++++++++++++++ docs/ru/sql-reference/data-types/index.md | 2 ++ docs/ru/sql-reference/syntax.md | 2 +- 6 files changed, 76 insertions(+), 2 deletions(-) diff --git a/docs/en/operations/system-tables.md b/docs/en/operations/system-tables.md index f364d4e306..d3d58834e6 100644 --- a/docs/en/operations/system-tables.md +++ b/docs/en/operations/system-tables.md @@ -176,6 +176,41 @@ This table contains a single String column called ‘name’ – the name of a d Each database that the server knows about has a corresponding entry in the table. This system table is used for implementing the `SHOW DATABASES` query. +## system.data_type_families {#system_tables-data_type_families} + +Contains information about supported [data types](../sql-reference/data-types/). + +Columns: + +- `name` ([String](../sql-reference/data-types/string.md)) — Data type name. +- `case_insensitive` ([UInt8](../sql-reference/data-types/int-uint.md)) — Property that shows whether you can use a data type name in a query in case insensitive manner or not. For example, `Date` and `date` are both valid. +- `alias_to` ([String](../sql-reference/data-types/string.md)) — Data type name for which `name` is an alias. + +**Example** + +``` sql +SELECT * FROM system.data_type_families WHERE alias_to = 'String' +``` + +``` text +┌─name───────┬─case_insensitive─┬─alias_to─┐ +│ LONGBLOB │ 1 │ String │ +│ LONGTEXT │ 1 │ String │ +│ TINYTEXT │ 1 │ String │ +│ TEXT │ 1 │ String │ +│ VARCHAR │ 1 │ String │ +│ MEDIUMBLOB │ 1 │ String │ +│ BLOB │ 1 │ String │ +│ TINYBLOB │ 1 │ String │ +│ CHAR │ 1 │ String │ +│ MEDIUMTEXT │ 1 │ String │ +└────────────┴──────────────────┴──────────┘ +``` + +**See Also** + +- [Syntax](../sql-reference/syntax.md) — Information about supported syntax. + ## system.detached\_parts {#system_tables-detached_parts} Contains information about detached parts of [MergeTree](../engines/table-engines/mergetree-family/mergetree.md) tables. The `reason` column specifies why the part was detached. For user-detached parts, the reason is empty. Such parts can be attached with [ALTER TABLE ATTACH PARTITION\|PART](../sql-reference/statements/alter.md#alter_attach-partition) command. For the description of other columns, see [system.parts](#system_tables-parts). If part name is invalid, values of some columns may be `NULL`. Such parts can be deleted with [ALTER TABLE DROP DETACHED PART](../sql-reference/statements/alter.md#alter_drop-detached). diff --git a/docs/en/sql-reference/data-types/index.md b/docs/en/sql-reference/data-types/index.md index da507b81ac..63ec877b70 100644 --- a/docs/en/sql-reference/data-types/index.md +++ b/docs/en/sql-reference/data-types/index.md @@ -10,4 +10,6 @@ ClickHouse can store various kinds of data in table cells. This section describes the supported data types and special considerations for using and/or implementing them if any. +You can check whether data type name is case-sensitive in the [system.data_type_families](../../operations/system-tables.md#system_tables-data_type_families) table. + [Original article](https://clickhouse.tech/docs/en/data_types/) diff --git a/docs/en/sql-reference/syntax.md b/docs/en/sql-reference/syntax.md index 70db90b38b..cca0111468 100644 --- a/docs/en/sql-reference/syntax.md +++ b/docs/en/sql-reference/syntax.md @@ -40,7 +40,7 @@ Keywords are case-insensitive when they correspond to: - SQL standard. For example, `SELECT`, `select` and `SeLeCt` are all valid. - Implementation in some popular DBMS (MySQL or Postgres). For example, `DateTime` is the same as `datetime`. -Whether data type name is case-sensitive can be checked in the `system.data_type_families` table. +You can check whether a data type name is case-sensitive in the [system.data_type_families](../operations/system-tables.md#system_tables-data_type_families) table. In contrast to standard SQL, all other keywords (including functions names) are **case-sensitive**. diff --git a/docs/ru/operations/system-tables.md b/docs/ru/operations/system-tables.md index 8954a48456..38971d6ee9 100644 --- a/docs/ru/operations/system-tables.md +++ b/docs/ru/operations/system-tables.md @@ -132,6 +132,41 @@ SELECT * FROM system.contributors WHERE name='Olga Khvostikova' Для каждой базы данных, о которой знает сервер, будет присутствовать соответствующая запись в таблице. Эта системная таблица используется для реализации запроса `SHOW DATABASES`. +## system.data_type_families {#system_tables-data_type_families} + +Содержит информацию о поддерживаемых [типах данных](../sql-reference/data-types/). + +Столбцы: + +- `name` ([String](../sql-reference/data-types/string.md)) — имя типа данных. +- `case_insensitive` ([UInt8](../sql-reference/data-types/int-uint.md)) — свойство, которое показывает, зависит ли имя типа данных в запросе от регистра. Например, допустимы и `Date`, и `date`. +- `alias_to` ([String](../sql-reference/data-types/string.md)) — тип данных, для которого `name` является алиасом. + +**Пример** + +``` sql +SELECT * FROM system.data_type_families WHERE alias_to = 'String' +``` + +``` text +┌─name───────┬─case_insensitive─┬─alias_to─┐ +│ LONGBLOB │ 1 │ String │ +│ LONGTEXT │ 1 │ String │ +│ TINYTEXT │ 1 │ String │ +│ TEXT │ 1 │ String │ +│ VARCHAR │ 1 │ String │ +│ MEDIUMBLOB │ 1 │ String │ +│ BLOB │ 1 │ String │ +│ TINYBLOB │ 1 │ String │ +│ CHAR │ 1 │ String │ +│ MEDIUMTEXT │ 1 │ String │ +└────────────┴──────────────────┴──────────┘ +``` + +**See Also** + +- [Синтаксис](../sql-reference/syntax.md) — поддерживаемый SQL синтаксис. + ## system.detached\_parts {#system_tables-detached_parts} Содержит информацию об отсоединённых кусках таблиц семейства [MergeTree](../engines/table-engines/mergetree-family/mergetree.md). Столбец `reason` содержит причину, по которой кусок был отсоединён. Для кусов, отсоединённых пользователем, `reason` содержит пустую строку. diff --git a/docs/ru/sql-reference/data-types/index.md b/docs/ru/sql-reference/data-types/index.md index 8b4f28aad3..65bce13a1a 100644 --- a/docs/ru/sql-reference/data-types/index.md +++ b/docs/ru/sql-reference/data-types/index.md @@ -8,5 +8,7 @@ toc_title: "\u0412\u0432\u0435\u0434\u0435\u043D\u0438\u0435" ClickHouse может сохранять в ячейках таблиц данные различных типов. +Зависимость имен типов данных от регистра можно проверить в системной таблице [system.data_type_families](../../operations/system-tables.md#system_tables-data_type_families). + Раздел содержит описания поддерживаемых типов данных и специфику их использования и/или реализации, если таковые имеются. [Оригинальная статья](https://clickhouse.tech/docs/ru/data_types/) diff --git a/docs/ru/sql-reference/syntax.md b/docs/ru/sql-reference/syntax.md index 24ab2be8a1..41a9c012b7 100644 --- a/docs/ru/sql-reference/syntax.md +++ b/docs/ru/sql-reference/syntax.md @@ -33,7 +33,7 @@ INSERT INTO t VALUES (1, 'Hello, world'), (2, 'abc'), (3, 'def') - Стандарту SQL. Например, применение любого из вариантов `SELECT`, `select` или `SeLeCt` не вызовет ошибки. - Реализации в некоторых популярных DBMS (MySQL или Postgres). Например, `DateTime` и `datetime`. -Зависимость от регистра для имён типов данных можно проверить в таблице `system.data_type_families`. +Зависимость от регистра для имён типов данных можно проверить в таблице [system.data_type_families](../operations/system-tables.md#system_tables-data_type_families). В отличие от стандарта SQL, все остальные ключевые слова, включая названия функций зависят от регистра. -- GitLab