The Ad-Hoc Query tab allows you to test your code in the development environment. You can check for errors and check whether your code works as expected. You do not need to commit and deploy ad hoc query nodes or set scheduling parameters for ad hoc query nodes.

To use the scheduling parameters, create a data analytics node or create a node in a workflow.

Create a folder

  1. Log on to the DataWorks console. In the left-side navigation pane, click Workspaces. On the Workspaces page, find the target workspace and click Data Analytics in the Actions column.
  2. In the left-side navigation pane, click Ad-Hoc Query. Move the pointer over the Create icon in the tool bar and select Folder.

    Click Expand in the lower-left corner to show or hide the left-side navigation pane.

  3. In the Create Folder dialog box, configure Folder Name and Location and click Commit.
    Note Multi-level folders are supported. You can create a folder in an existing folder.

Create a node

On the Ad-Hoc Query page, move the pointer over the Create icon and select Create to create ODPS SQL, Shell, AnalyticDB for PostgreSQL, AnalyticDB for MySQL, and Data Lake Analytics nodes.

For example, to create an ODPS SQL node, follow these steps:
  1. Right-click a folder name and choose Create Node > ODPS SQL.
  2. In the Create Node dialog box, configure Node Name and Location and click Commit.
  3. Edit the code of the ODPS SQL node.Edit code
    The following table describes icons on the interface.
    No. Icon Description
    1 Save Save the entered code for the current node.
    2 Steal Lock Steal the lock of the current node and then edit it if you are not the owner of the node.
    3 Expense Estimate Estimate the cost of running the current node.
    4 Run Run the current node in the development environment.
    5 Run with Arguments Run the code of the current node with the configured parameters.
    Note This feature is unavailable for Shell nodes.
    6 Stop Stop running the current node.
    7 Reload Reload the code of the current node. The code will be restored to the version last saved. Unsaved changes will be lost.
    Note If Auto Save is selected on the Configuration Center tab, you are notified of the code that is cached but not saved after the page is refreshed. In this case, select the version that you need.
    8 Format Code Format the code based on keywords to avoid excessively long code in a single line.
  4. After code editing is completed, click the Run icon to view the result.