mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
ec53b27473
Co-Authored-By: Ivan Blinkov <github@blinkov.ru>
46 lines
1.3 KiB
Markdown
46 lines
1.3 KiB
Markdown
# HDFS {#table_engines-hdfs}
|
|
|
|
This engine provides integration with [Apache Hadoop](https://en.wikipedia.org/wiki/Apache_Hadoop) ecosystem by allowing to manage data on [HDFS](https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HdfsDesign.htmll)via ClickHouse. This engine is similar
|
|
to the [File](file.md) and [URL](url.md) engines, but provides Hadoop-specific features.
|
|
|
|
## Usage
|
|
|
|
```
|
|
ENGINE = HDFS(URI, format)
|
|
```
|
|
|
|
The `format` parameter specifies one of the available file formats. To perform
|
|
`SELECT` queries, the format must be supported for input, and to perform
|
|
`INSERT` queries -- for output. The available formats are listed in the
|
|
[Formats](../../interfaces/formats.md#formats) section.
|
|
|
|
**Example:**
|
|
|
|
**1.** Set up the `HDFS_engine_table` table:
|
|
|
|
``` sql
|
|
CREATE TABLE hdfs_engine_table (name String, value UInt32) ENGINE=HDFS('hdfs://hdfs1:9000/other_storage', 'TSV')
|
|
```
|
|
**2.** Query the data:
|
|
|
|
``` sql
|
|
SELECT * FROM hdfs_engine_table LIMIT 2
|
|
```
|
|
|
|
```
|
|
┌─name─┬─value─┐
|
|
│ one │ 1 │
|
|
│ two │ 2 │
|
|
└──────┴───────┘
|
|
```
|
|
|
|
## Details of Implementation
|
|
|
|
- Reads and writes can be parallel
|
|
- Not supported:
|
|
- `ALTER` and `SELECT...SAMPLE` operations.
|
|
- Indexes.
|
|
- Replication.
|
|
|
|
[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/hdfs/) <!--hide-->
|