ClickHouse/docs/tr/engines/table-engines/mergetree-family/graphitemergetree.md
BayoNet dba72d73fe
DOCS-624: Fixing links to nowhere (#10675)
* enbaskakova-DOCSUP-652 (#101)

* "docs(orNull&orDefault): Functions 'orNull&orDefault' have been edited"

* "docs(orNull&orDefault): Functions 'orNull&orDefault' have been edited"

* "docs(orNull&orDefault): Functions 'orNull&orDefault' have been edited"

* Update docs/en/sql_reference/aggregate_functions/combinators.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql_reference/aggregate_functions/combinators.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql_reference/aggregate_functions/combinators.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql_reference/aggregate_functions/combinators.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql_reference/aggregate_functions/combinators.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* "docs(orNull&orDefault): Functions 'orNull&orDefault' have been edited"

* "docs(orNull&orDefault): Functions 'orNull&orDefault' have been edited"

* "docs(orNull&orDefault): Functions 'orNull&orDefault' have been edited"

Co-authored-by: elenbaskakova <elenbaskakova@yandex-team.ru>
Co-authored-by: BayoNet <da-daos@yandex.ru>

* Revert "enbaskakova-DOCSUP-652 (#101)" (#107)

This reverts commit 639fee7610.

* CLICKHOUSEDOCS-624: Fixed links. Was 60, became 13.

* CLICKHOUSEDOCS-624: Finished fix links in Enlish version.

* CLICKHOUSEDOCS-624: Fixed RU links

Co-authored-by: elenaspb2019 <47083263+elenaspb2019@users.noreply.github.com>
Co-authored-by: elenbaskakova <elenbaskakova@yandex-team.ru>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
2020-05-06 09:13:29 +03:00

6.0 KiB
Raw Blame History

machine_translated machine_translated_rev toc_priority toc_title
true e8cd92bba3 38 Graphıtemergetree

Graphıtemergetree

Bu motor inceltme ve toplama/ortalama (toplaması) için tasarlanmıştır) Grafit veriler. Clickhouseu Grafit için bir veri deposu olarak kullanmak isteyen geliştiriciler için yararlı olabilir.

Toplamaya ihtiyacınız yoksa Grafit verilerini depolamak için herhangi bir ClickHouse tablo motorunu kullanabilirsiniz, ancak bir toplamaya ihtiyacınız varsa GraphiteMergeTree. Motor, depolama hacmini azaltır ve grafitten gelen sorguların verimliliğini arttırır.

Motor özellikleri devralır MergeTree.

Tablo oluşturma

CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster]
(
    Path String,
    Time DateTime,
    Value <Numeric_type>,
    Version <Numeric_type>
    ...
) ENGINE = GraphiteMergeTree(config_section)
[PARTITION BY expr]
[ORDER BY expr]
[SAMPLE BY expr]
[SETTINGS name=value, ...]

Ayrıntılı bir açıklamasını görmek CREATE TABLE sorgu.

Grafit verileri için bir tablo aşağıdaki veriler için aşağıdaki sütunlara sahip olmalıdır:

  • Metrik adı (Grafit sensörü). Veri türü: String.

  • Metrik ölçme zamanı. Veri türü: DateTime.

  • Metrik değeri. Veri türü: herhangi bir sayısal.

  • Metrik sürümü. Veri türü: herhangi bir sayısal.

    ClickHouse en yüksek sürümü veya sürümleri aynı ise son yazılan satırları kaydeder. Veri parçalarının birleştirilmesi sırasında diğer satırlar silinir.

Bu sütunların adları toplaması yapılandırmasında ayarlanmalıdır.

Graphıtemergetree parametreleri

  • config_section — Name of the section in the configuration file, where are the rules of rollup set.

Sorgu yan tümceleri

Oluştururken bir GraphiteMergeTree tablo, aynı yanlar oluşturul ,urken olduğu gibi gerekli MergeTree Tablo.

Bir tablo oluşturmak için kullanımdan kaldırılan yöntem

!!! attention "Dikkat" Bu yöntemi yeni projelerde kullanmayın ve mümkünse eski projeleri yukarıda açıklanan yönteme geçin.

CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster]
(
    EventDate Date,
    Path String,
    Time DateTime,
    Value <Numeric_type>,
    Version <Numeric_type>
    ...
) ENGINE [=] GraphiteMergeTree(date-column [, sampling_expression], (primary, key), index_granularity, config_section)

Hariç tüm parametreler config_section içinde olduğu gibi aynı anlama sahip MergeTree.

  • config_section — Name of the section in the configuration file, where are the rules of rollup set.

Toplaması Yapılandırması

Toplaması için ayarları tarafından tanımlanan graphite_rollup sunucu yapılandırmasında parametre. Parametrenin adı herhangi biri olabilir. Birkaç yapılandırma oluşturabilir ve bunları farklı tablolar için kullanabilirsiniz.

Toplaması yapılandırma yapısı:

  required-columns
  patterns

Gerekli Sütunlar

  • path_column_name — The name of the column storing the metric name (Graphite sensor). Default value: Path.
  • time_column_name — The name of the column storing the time of measuring the metric. Default value: Time.
  • value_column_name — The name of the column storing the value of the metric at the time set in time_column_name. Varsayılan değer: Value.
  • version_column_name — The name of the column storing the version of the metric. Default value: Timestamp.

Desenler

Bu yapı patterns bölme:

pattern
    regexp
    function
pattern
    regexp
    age + precision
    ...
pattern
    regexp
    function
    age + precision
    ...
pattern
    ...
default
    function
    age + precision
    ...

!!! warning "Dikkat" Desenler kesinlikle sipariş edilmelidir:

  1. Patterns without `function` or `retention`.
  1. Patterns with both `function` and `retention`.
  1. Pattern `default`.

Bir satır işlerken, ClickHouse kuralları denetler pattern bölmeler. Tüm pattern (içeren default) bölümler içerebilir function toplama için parametre, retention parametreler veya her ikisi. Metrik adı eşleşirse regexp gelen kuralları pattern bölüm (veya bölümler) uygulanır; aksi takdirde, kurallar default bölüm kullanılır.

Alanlar için pattern ve default bölmeler:

  • regexp A pattern for the metric name.
  • age The minimum age of the data in seconds.
  • precision How precisely to define the age of the data in seconds. Should be a divisor for 86400 (seconds in a day).
  • function The name of the aggregating function to apply to data whose age falls within the range [age, age + precision].

Yapılandırma Örneği

<graphite_rollup>
    <version_column_name>Version</version_column_name>
    <pattern>
        <regexp>click_cost</regexp>
        <function>any</function>
        <retention>
            <age>0</age>
            <precision>5</precision>
        </retention>
        <retention>
            <age>86400</age>
            <precision>60</precision>
        </retention>
    </pattern>
    <default>
        <function>max</function>
        <retention>
            <age>0</age>
            <precision>60</precision>
        </retention>
        <retention>
            <age>3600</age>
            <precision>300</precision>
        </retention>
        <retention>
            <age>86400</age>
            <precision>3600</precision>
        </retention>
    </default>
</graphite_rollup>

Orijinal makale