You can use the ad hoc query feature provided by DataStudio to execute SQL statements in the MaxCompute project associated with your DataWorks workspace.
Create an ad hoc query node
- Log on to the DataWorks console.
- In the left-side navigation pane, click Workspaces.
- In the top navigation bar, select the region where the workspace that you want to manage resides. Find the workspace in the list and click Data Analytics in the Actions column.
- On the left-side navigation submenu, click the Ad Hoc Query icon.
- In the Ad Hoc Query pane, right-click Ad Hoc Query and choose .
- In the Create Node dialog box, set the Node Name and Location parameters.
Note The node name must be 1 to 128 characters in length.
- Click Commit.
Execute SQL statements
After the ad hoc query node is committed, you can execute SQL statements supported by MaxCompute in the node. For more information, see MaxCompute SQL overview.
create table if not exists sale_detail ( shop_name string, customer_id string, total_price double ) partitioned by (sale_date string,region string); -- Create a partitioned table named sale_detail.
View the execution details and result in the Runtime Log section. If the SQL statement is successfully executed, the result is shown as OK.
You can execute SQL query statements in the same way.