You can export the queries on the fields you parameterized. To export a query,
perform these steps:
-
On the Query home page, select a query you want to export and click the
Configure Export
button.
The Configure Export page appears with the parameterized fields in the Parameters workspace.Note: You can export a query only if you have the required privileges.
-
In the Parameters workspace, you have the option to
either:
- Export the query based on the default field values, or
- Enter a new set of values on runtime to export the query.
-
After you choose to export your data, click
Preview.
You see, the set of records fetched by the query in the Preview section. By default, a maximum of 50 records at a time can be shown.
-
To export the query in .csv or .txt format, do as follows:
-
On the File Name field, click the
Choose File button.
The Save File pop-up is displayed.
-
Use the file path selection box to go to the required path on
the server.
A list of files at the selected location is displayed below the file path selection box.
- Select an existing file or name a different file in the Name field with an appropriate extension in the file name, to indicate the desired compression format to be used while exporting the file.
- Click OK.
-
Select a Field Separator from the drop-down list
to specify a character to separate fields in a delimited file. The
characters available to define as field separators are:
Note: By default, the field separator is set to 'Comma'.
-
Space
-
Tab
-
Comma
-
Period
-
Semicolon
-
Pipe
-
-
Select a Record Separator from the drop-down
list to specify the character to separate records in line in a
sequential or delimited file. The record separator settings available
are:
Note: By default, the record separator is set to 'Default'.
- Unix (U+000A) - A line feed character separates the records. This is the standard record separator for Unix systems.
- Macintosh (U+000D) - A carriage return character separates the records. This is the standard record separator for Macintosh systems.
- Windows (U+000D U+000A) - A carriage return followed by a line feed separates the records. This is the standard record separator for Windows systems.
-
Click the Export button to export the complete
set of data fetched from the query. As you click, a spinner appears on
the button to show the progress, which keeps on spinning until the file
gets exported.
The output file will be generated on the server or other available connections, such as FTP, SFTP, Cloud, HDFS, and more, as selected in the previous steps, and the system will retain the last exported path in the File Name field.Note: You must have the permissions below on the entities to export a query, which can be accessed through System > Security in the management console:
Entity Type Permission View Execute Query (in Spectrum Discovery) Model Store (in Spectrum Discovery) Jobs (in Platform) Resources - JDBC Drivers (in Resource Connection) Data Source* (in Resource Connection) * Whichever data source is being used underneath the model store connection.
-
On the File Name field, click the
Choose File button.