Configuring access to Object Storage from a ClickHouse cluster
Managed Service for ClickHouse lets you use Object Storage to:
- Enable ML models for inference and data format schemas.
- Process data that is stored in object storage if this data is represented in any of the supported ClickHouse formats
.
To access Object Storage bucket data from a cluster, you need to get a link to the bucket object.
See Examples of working with objects.
Getting a link to an object
To use Managed Service for ClickHouse to work with data of an object in Object Storage, you need to get a link to this object in the bucket.
A link like https://storage.ai.nebius.cloud/<bucket name>/<object name>?X-Amz-Algorithm=...
should be changed to https://storage.ai.nebius.cloud/<bucket name>/<object name>
. To do this, delete all parameters in the query string.
Examples of working with objects
You can use object links like https://storage.ai.nebius.cloud/<bucket name>/<object name>
to work with geotags and schemas or to use the s3
table function and the S3
table engine.
The S3
table engine is similar to FileSELECT
and INSERT
.
The s3
table function provides the same functionality as the S3
table engine, but you don't need to create a table before using it.
For example, if the Object Storage bucket has a table.tsv
file that stores table data in TSV format, then you can create a table or function that will work with this file. You must set up password-free access and obtain a link to the table.tsv
file first.
-
Create a table:
CREATE TABLE test (n Int32) ENGINE = S3('https://storage.ai.nebius.cloud/<bucket name>/table.tsv', 'TSV');
-
Run test queries to the table:
INSERT INTO test VALUES (1); SELECT * FROM test; ┌─n─┐ │ 1 │ └───┘
-
Insert data:
INSERT INTO FUNCTION s3('https://storage.ai.nebius.cloud/<bucket name>/table.tsv', 'TSV', 'n Int32') VALUES (1);
-
Run a test query:
SELECT * FROM s3('https://storage.ai.nebius.cloud/<bucket name>/table.tsv', 'TSV', 'n Int32'); ┌─n─┐ │ 1 │ └───┘