Search code examples
amazon-web-servicesaws-sdkaws-iot-analytics

AWS IOT ANALYTICS


am trying to fetch data from iot analytics(AWS) from my java sdk, I have created channels and pipeline and data are in the datasets

does anyone have idea about aws iot analytics data fetch mechanism?


Solution

  • AWS IoT Analytics distinguishes between raw data stored in channels, processed data stored in datastores and queried data stored in data sets.

    As part of creating the dataset with CreateDatasetContent [1], you'll write your SQL query which runs against your datastore and produces the result set stored in your dataset. This guy can either be run ad-hoc or periodically every x hours. After you created the dataset successfully, you can get the query result via the GetDatasetContent API [2].

    Please note that the CreateDatasetContent API is async, meaning you'll need to wait until the query ran successfully. By default, GetDatasetContent will always return you the latest successful result which might be empty directly after creating the dataset since the query hasn't finished yet. In order to get the current state of your query, you can pass the optional version=$LATEST parameter to the GetDatasetContent call. This will give you more information about the currently running query or whether it failed to execute.

    Hope this helps

    [1] https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_CreateDatasetContent.html

    [2] https://docs.aws.amazon.com/iotanalytics/latest/APIReference/API_GetDatasetContent.html