ClickHouse/docs/en/sql-reference/table-functions/deltalake.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
2.4 KiB
Markdown
Raw Normal View History

2023-01-05 20:54:44 +00:00
---
slug: /en/sql-reference/table-functions/deltalake
2023-01-10 21:18:50 +00:00
sidebar_label: DeltaLake
2023-01-05 20:54:44 +00:00
---
2023-01-10 16:14:12 +00:00
# deltaLake Table Function
2023-01-05 20:54:44 +00:00
2023-01-10 16:14:12 +00:00
Provides a read-only table-like interface to [Delta Lake](https://github.com/delta-io/delta) tables in Amazon S3.
2023-01-05 20:54:44 +00:00
2023-01-10 16:14:12 +00:00
## Syntax
2023-01-05 20:54:44 +00:00
``` sql
2023-01-11 12:53:37 +00:00
deltaLake(url [,aws_access_key_id, aws_secret_access_key] [,format] [,structure] [,compression])
2023-01-05 20:54:44 +00:00
```
2023-01-10 16:14:12 +00:00
## Arguments
2023-01-05 20:54:44 +00:00
2023-01-11 12:53:37 +00:00
- `url` — Bucket url with path to existing Delta Lake table in S3.
2023-01-10 16:14:12 +00:00
- `aws_access_key_id`, `aws_secret_access_key` - Long-term credentials for the [AWS](https://aws.amazon.com/) account user. You can use these to authenticate your requests. These parameters are optional. If credentials are not specified, they are used from the ClickHouse configuration. For more information see [Using S3 for Data Storage](/docs/en/engines/table-engines/mergetree-family/mergetree.md/#table_engine-mergetree-s3).
- `format` — The [format](/docs/en/interfaces/formats.md/#formats) of the file.
- `structure` — Structure of the table. Format `'column1_name column1_type, column2_name column2_type, ...'`.
- `compression` — Parameter is optional. Supported values: `none`, `gzip/gz`, `brotli/br`, `xz/LZMA`, `zstd/zst`. By default, compression will be autodetected by the file extension.
2023-01-05 20:54:44 +00:00
**Returned value**
2023-01-10 16:14:12 +00:00
A table with the specified structure for reading data in the specified Delta Lake table in S3.
2023-01-05 20:54:44 +00:00
**Examples**
2023-01-10 16:14:12 +00:00
Selecting rows from the table in S3 `https://clickhouse-public-datasets.s3.amazonaws.com/delta_lake/hits/`:
2023-01-05 20:54:44 +00:00
``` sql
2023-01-10 16:14:12 +00:00
SELECT
URL,
UserAgent
FROM deltaLake('https://clickhouse-public-datasets.s3.amazonaws.com/delta_lake/hits/')
WHERE URL IS NOT NULL
LIMIT 2
2023-01-05 20:54:44 +00:00
```
2023-01-10 16:14:12 +00:00
``` response
┌─URL───────────────────────────────────────────────────────────────────┬─UserAgent─┐
│ http://auto.ria.ua/search/index.kz/jobinmoscow/detail/55089/hasimages │ 1 │
│ http://auto.ria.ua/search/index.kz/jobinmoscow.ru/gosushi │ 1 │
└───────────────────────────────────────────────────────────────────────┴───────────┘
2023-01-05 20:54:44 +00:00
```
**See Also**
2023-01-10 16:18:33 +00:00
- [DeltaLake engine](/docs/en/engines/table-engines/integrations/deltalake.md)
2023-01-05 20:54:44 +00:00