Querying Data Archived in Blob


This tutorial guides you through querying asset history data that is archived in Blob with a Data Federation read channel.

Prerequisites

  • You are authorized to use the Data Federation and Data Archiving modules.

  • Your organization has requested for the Data Federation and Data Archiving resources.

  • Connected devices have been uploading data to EnOS Cloud.

  • The Blob data source is registered through Data Source Registration.

Procedure

This tutorial walks you through a typical path of querying asset history data that is archived in Blob, which is:

  • Creating a data archiving job to archive asset data to the Blob storage

  • Creating a data federation read channel for binding the Blob data source

  • Authorizing an SA to access data with the data federation channel and starting the channel

  • Querying and analyzing archived data stored in the Blob storage with the data federation channel

Scenario

The scenario of this tutorial is archiving the real-time data of an asset (asset ID VmpNv9KO) to an external Blob storage and querying the archived data with a data federation read channel.

Creating a Data Archiving Job

Take the following steps to create a data archiving job for the asset real-time data.

  1. Complete the basic information and storage configuration of the data archiving job.

    ../_images/creating_archiving_job_1.jpg
  2. Set the archiving cycle and select All Models for the content configuration.

    ../_images/creating_archiving_job_2.jpg
  3. On the Device Asset management page, verify that the measurement points of the VmpNv9KO asset are uploading data to EnOS Cloud.

    ../_images/creating_archiving_job_3.jpg

Creating a Data Federation Channel

Take the following steps to create a data federation channel and bind the Blob data source.

  1. Create a data federation read channel.

    ../_images/creating_federation_channel_1.jpg
  2. Add the registered Blob data source.

    ../_images/creating_federation_channel_2.jpg

Authorizing and Starting the Channel

Take the following steps to authorize an SA to access data with the data federation channel and then start the channel.

  1. Authorize an SA to access data with the data federation channel.

    ../_images/authorizing_app.jpg
  2. Start the channel and enable the cross-source analysis function.

    ../_images/starting_channel.jpg

Querying Archived Data in the Blob Storage

Take the following steps to query and analyze archived asset data in the Blob storage.

  1. When the data federation channel is running, view the schema and files of the Blob storage with the Federation Query function.

    ../_images/querying_data_1.jpg
  2. Find the archived file. For example, the path of the archived file is: /dataconnector/beta/real/20200925/12/real_20200925T1200_zqAzIf.csv.

    ../_images/querying_data_2.jpg
  3. Enter the following SQL statement in the editor:

    SELECT * FROM dataconnector002.qatest.`/dataconnector/beta/real/20200925/12/real_20200925T1200_zqAzIf.csv`
    
  4. View the data querying results. For example:

    ../_images/querying_data_3.jpg