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:
Log in EnOS Management Console and select Data Federation > Federation Query.
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.
Note
Cross-OU access to HDFS and HIVE data sources is now supported.
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.
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.
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.
Click the Run icon in the tool bar to execute data query.
In the result panel, view the running result of the SQL statement. See the followling example:
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:
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.
Click Query History to view the SQL query records in the last 3 days, including the query channel, SQL statement, and query time.
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.
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.
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.
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.
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.