For similar capabilities to Amazon IoT Analytics, explore Amazon Kinesis, Amazon S3, and Amazon Athena. These services provide additional scalability and flexibility to meet your evolving analytics requirements. Learn how
here
Load and verify data
The data you query in this tutorial is a sample set of Amazon IoT SiteWise data that models wind engine turbines in a wind farm.
Note
You will query three tables in your data store throughout this tutorial:
-
raw
‐ Contains raw, unprocessed data for each asset. -
asset_metadata
‐ Contains general information about each asset. -
asset_hierarchy_metadata
‐ Contains information about the relationships between assets.
To run the SQL queries in this tutorial
-
Follow the steps in Create a dataset with Amazon IoT SiteWise data (Console) or Create a dataset with Amazon IoT SiteWise data (Amazon CLI) to create an Amazon IoT Analytics dataset for your Amazon IoT SiteWise data.
-
To update your dataset query throughout this tutorial, do the following.
-
In the Amazon IoT Analytics console, on the Datasets page, choose the name of the dataset you created on the previous page.
-
On the dataset summary page, choose Edit to edit your SQL query.
-
To display the results in a table following the query, choose Test query.
Alternatively, you can run the following
update-dataset
command to modify the SQL query with the Amazon CLI.aws iotanalytics update-dataset --cli-input-json file://update-query.json
Contents of
update-query.json
:{ "datasetName": "my_dataset", "actions": [ { "actionName": "myDatasetUpdateAction", "queryAction": { "sqlQuery": "SELECT * FROM my_iotsitewise_datastore.asset_metadata LIMIT 3" } } ] }
-
-
In the Amazon IoT Analytics console or with the Amazon CLI, run the following query on your data to verify that your
asset_metadata
table loaded successfully.SELECT COUNT(*) FROM my_iotsitewise_datastore.asset_metadata
Count 97
Similarly, you can verify that your
asset_hierarchy_metadata
andraw
tables aren't empty.