Reuse Your Queries

You can export a query to a Spark SQL link to then use it from your analytics processors code. You can also use the exported query as a basis for more complex queries.

  1. Open the worksheet that contains the query you want to reuse.
  2. Click the Export icon Export Icon for your query.
  3. Enter a name to identify the SQL Spark link that will be created as a result of exporting this query.
  4. (Optional) Enter a brief description of this link.
  5. From the Analytics Object list, select the analytics object that contains the data structure that matches the table you’re querying.
    When you read data from the resulting Spark SQL link in your analytics processor, the read method returns an analytic object of this type.
  6. Click Create.
The Spark SQL link with your query is created. To view and edit your link, select links from the main menu and then select the link that uses the name you specified above.
You can use the exported query as a basis for a more complex query. To do this, edit the SQL link you just created and edit the Spark SQL query it contains.