- The data is in S3, so we can use the
s3table function to create a table from the files. We can also query the data in place. Let’s look at a few rows before attempting to insert it into ClickHouse:
- We will use the following
MergeTreetable to store the data in ClickHouse:
- We will use the
s3Clustertable function, which distributes the S3 files among the nodes of your cluster so they are read in parallel. In ClickHouse Cloud, your cluster is nameddefaultand you can run this as shown. On a self-managed server, replacedefaultwith the name of your cluster — or, if you are running a single server, use thes3table function instead, dropping the first argument so the call starts with the URL.
- Let’s see how much storage disk is needed for the
sensorstable:
- Let’s analyze the data now that it’s in ClickHouse. Notice the quantity of data increases over time as more sensors are deployed:
- This query counts the number of overly hot and humid days: