This is an extension to the s3 table function.
Allows processing files from Amazon S3 and Google Cloud Storage Google Cloud Storage in parallel with many nodes in a specified cluster. On initiator it creates a connection to all nodes in the cluster, discloses asterisks in S3 file path, and dispatches each file dynamically. On the worker node it asks the initiator about the next task to process and processes it. This is repeated until all tasks are finished.
Syntax
Arguments
Arguments can also be passed using named collections. In this case url, access_key_id, secret_access_key, format, structure, compression_method work in the same way, and some extra parameters are supported:
Returned value
A table with the specified structure for reading or writing data in the specified file.
Examples
Select the data from all the files in the /root/data/clickhouse and /root/data/database/ folders, using all the nodes in the cluster_simple cluster:
Count the total amount of rows in all files in the cluster cluster_simple:
If your listing of files contains number ranges with leading zeros, use the construction with braces for each digit separately or use ?.
For production use cases, it is recommended to use named collections. Here is the example:
Accessing private and public buckets
Users can use the same approaches as document for the s3 function here.
For details on optimizing the performance of the s3 function see our detailed guide.