access-key-id and access-key-secret entered in the table function must have permission to read the corresponding oss-file-path.oss-file-path parameter needs to meet the OSS path format specification, which is oss://<bucket-name/<path-to-file> typically.CREATE TABLE cos_engine_table(`int_id` UInt32)ENGINE = S3('http://clickhouse-xxx.myqcloud.com/clickhouse-xxx/cos/data.csv.gz', 'CSV', 'gzip')
S3(path, [aws_access_key_id, aws_secret_access_key,] format, [compression]).aws_access_key_id and aws_secret_access_key: permanent credentials of COS account. You can use them to authenticate your request. These parameters are optional. If no credentials are specified, credentials will be read from the configuration file. For more information, see Using S3 to Store Data.none, gzip/gz, brotli/br, xz/LZMA, and zstd/zst. This parameter is optional. The compression type is automatically detected based on the file extension by default.CREATE TABLE test.test on cluster default_cluster(`int_id` UInt32)engine = MergeTree()order by int_id;
- If your cluster has two replicas:
create table test.test on cluster default_cluster(`int_id` UInt32)engine = ReplicatedMergeTree('/clickhouse/tables/test/test/{shard}', '{replica}')order by int_id;
- Create a distributed table:
create table test.test_dis on cluster default_clusterAS test.testengine = Distributed('default_cluster', 'test', 'test', rand());
INSERT INTO test.test SELECT * FROM cos_engine_table;
select * from test.test
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback