Exporting a Query

You can export the queries on the fields you parameterized. To export a query, perform these steps:
  1. 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.
  2. 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.
  3. 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.
  4. To export the query in .csv or .txt format, do as follows:
    1. On the File Name field, click the Choose File button.
      The Save File pop-up is displayed.
    2. 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.
    3. 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.
    4. Click OK.
    5. 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

    6. 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.
    7. 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.