Querying Data Online


Data Federation service provides a visual interface for developers to query data from various data sources and helps with debugging and analysis.

Prerequisites

  • At least 1 read channel is created and running.
  • The read channel has been authorized to specified applications

Querying Data

Take the following steps to query data with SQL statement from a data source that is bound to a channel:

  1. Log in EnOS Management Console and select Data Federation > Federation Query.

  2. From the Channel and Data Source fields, select the running read channel and the application that is authorized to read data through the selected channel. The data source that is bound to the channel will be displayed.

    _images/selecting_federation_channel.png


    Note

    Cross-OU access to HDFS and HIVE data sources is now supported.

    _images/selecting_federation_channel_1.png
  3. Open the data source to view the databases and tables in the data source. Select any data table to preview the Schema and data of the data table in the query panel on the right.

    _images/previewing_data.png

    Cross-OU access to HDFS and HIVE data sources is now supported. If there are other data sources under this data source category that have been licensed to the OU, click on the data source to display all the data sources under the licensed OU.

    Click on this data source for another OU.

    • If you have the root path permission: you can preview the file data under the root path in the Preview subsection.

    • If there is no root path permission: you can view the authorized subpaths in the Authority subsection. In the query panel, enter the specific subpath SQL statement to query.

      Note

      The query statement does not support wildcards. If you authorize HDFS data sources with wildcards, you need to write specific paths. For details, see Syntax Rules for HDFS Queries.

    _images/authority_data.png
  4. In the query panel on the right, enter SQL statement to query data from the select data source. When entering the SQL statement, you can refer to dynamic syntax hint.

    _images/entering_sql_query.png
  5. Click the Run icon in the tool bar to execute data query.

  6. In the result panel, view the running result of the SQL statement. See the followling example:

    _images/viewing_sql_results.png


    If the federation channel has cross-source analysis function enabled, the system will query data from all the bound data sources with the same SQL statement. See the followling example:

    _images/viewing_sql_results_1.png


For SQL syntax and examples to query data from various data sources, see SQL Statement Samples.

Viewing Data Query History

The data query records will be saved automatically for reference and reuse.

  1. Click Query History to view the SQL query records in the last 3 days, including the query channel, SQL statement, and query time.

    _images/viewing_sql_history.png
  2. In the list of query records, click the Requery icon, the SQL statement will be copied to the query panel. Click Run to execute the data query again.

    _images/rerun_sql_query.png
  3. In the list of query records, click the Add to Collections icon, enter the query name, and click Save to add the query to collections.

    _images/saving_sql_query.png
  4. Click SQL Query Results in the upper right corner of the result panel to view the running result of the latest SQL query.

Manage the Collections

You can use the collections to manage commonly used SQL query conditions.

  1. Click Collections to view all the saved SQL query conditions, including the query channel, SQL statement, and the time when query is added to collections.

    _images/saved_sql_query.png
  2. In the list of saved query conditions, click the Query icon to rerun the SQL query; click the Delete icon to remove a saved query.