ClickHouse/docs/ja/engines/table-engines/integrations/hdfs.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

4.5 KiB
Raw Blame History

machine_translated machine_translated_rev toc_priority toc_title
true d734a8e46d 36 HDFS

HDFS

このエンジンは、 Apache Hadoop データの管理を可能にすることによって生態系 HDFSクリックハウス経由。 このエンジンは同様です に ファイルURL エンジンが、Hadoop固有の機能を提供します。

使い方

ENGINE = HDFS(URI, format)

その URI parameterは、HDFSのファイルURI全体です。 その format パラメータを指定するか、ファイルのファイルフォーマット 実行するには SELECT クエリは、形式は、入力のためにサポートされ、実行する必要があります INSERT queries for output. The available formats are listed in the 形式 セクション。 のパス部分 URI グロブを含む可能性があります。 この場合、テーブルは読み取り専用になります。

例えば:

1. セットアップ hdfs_engine_table テーブル:

CREATE TABLE hdfs_engine_table (name String, value UInt32) ENGINE=HDFS('hdfs://hdfs1:9000/other_storage', 'TSV')

2. Fillファイル:

INSERT INTO hdfs_engine_table VALUES ('one', 1), ('two', 2), ('three', 3)

3. データのクエリ:

SELECT * FROM hdfs_engine_table LIMIT 2
┌─name─┬─value─┐
│ one  │     1 │
│ two  │     2 │
└──────┴───────┘

実装の詳細

  • 読み書きできる並列
  • サポートなし:
    • ALTERSELECT...SAMPLE オペレーション
    • インデックス。
    • 複製だ

パス内のグロブ

複数のパスコンポーネン のための処理中のファイルが存在するマッチのパスのパターンです。 ファイルのリストは、 SELECT (ないで CREATE 瞬間)。

  • * — Substitutes any number of any characters except / 空の文字列を含む。
  • ? — Substitutes any single character.
  • {some_string,another_string,yet_another_one} — Substitutes any of strings 'some_string', 'another_string', 'yet_another_one'.
  • {N..M} — Substitutes any number in range from N to M including both borders.

構造との {} に類似していて下さい リモート テーブル機能。

例えば

  1. HDFSに次のUriを持つTSV形式のファイルがいくつかあるとします:
  • hdfs://hdfs1:9000/some_dir/some_file_1
  • hdfs://hdfs1:9000/some_dir/some_file_2
  • hdfs://hdfs1:9000/some_dir/some_file_3
  • hdfs://hdfs1:9000/another_dir/some_file_1
  • hdfs://hdfs1:9000/another_dir/some_file_2
  • hdfs://hdfs1:9000/another_dir/some_file_3
  1. あはいくつかの方法が考えられているテーブルの構成は、すべてのファイル:
CREATE TABLE table_with_range (name String, value UInt32) ENGINE = HDFS('hdfs://hdfs1:9000/{some,another}_dir/some_file_{1..3}', 'TSV')

別の方法:

CREATE TABLE table_with_question_mark (name String, value UInt32) ENGINE = HDFS('hdfs://hdfs1:9000/{some,another}_dir/some_file_?', 'TSV')

テーブルはすべてのファイルの両方のディレクトリ(すべてのファイルが満たすべき書式は、スキーマに記載のクエリ):

CREATE TABLE table_with_asterisk (name String, value UInt32) ENGINE = HDFS('hdfs://hdfs1:9000/{some,another}_dir/*', 'TSV')

!!! warning "警告" ファイルのリストに先行するゼロが付いた数値範囲が含まれている場合は、各桁ごとに中かっこで囲みます。 ?.

例えば

このように作成されたテーブルとファイル名 file000, file001, … , file999:

CREARE TABLE big_table (name String, value UInt32) ENGINE = HDFS('hdfs://hdfs1:9000/big_dir/file{0..9}{0..9}{0..9}', 'CSV')

仮想列

  • _path — Path to the file.
  • _file — Name of the file.

また見なさい

元の記事