Features of DataWorks Copilot
Intelligent code completion
DataWorks Copilot intelligently completes the SQL statements that you write based on the obtained context information. You can press the TAB
key to accept the completion results, press CTRL + →
to accept partial results, or press the ESC
key to abandon the completion results.

If you do not want to see code hints when you modify the code, you can click the
icon in the lower-right corner of the code editor to disable the intelligent code completion feature.

Code generation
DataWorks Copilot automatically converts the natural language prompts that you input into SQL statements. The following methods are supported:
In the code editor, right-click a blank area and choose to go to the DataWorks Copilot configuration page. On the DataWorks Copilot configuration page, enter a command, click Send, and then wait for DataWorks Copilot to return the result.


In the upper-right corner of the Data Studio page, click
. In the DataWorks Copilot chat window that appears on the right side of the configuration page, enter /
. In the pop-up list, select Code generation
, and then enter natural language prompts to request the LLM to return the required code.

Code rewriting
In the code editor, select a code snippet, and click
in the upper-right corner of the Data Studio page. In the DataWorks Copilot chat window, enter your rewrite request and click Send. Wait for DataWorks Copilot to return the result.

Comment generation
DataWorks Copilot generates comments for specified SQL statements to improve the readability of the SQL statements. In the code editor, select a code snippet and right-click the code snippet to choose , enter your command, click Send, and then wait for DataWorks Copilot to return the result.

Code interpretation
DataWorks Copilot interprets specified SQL statements to improve the readability of the SQL statements. In the code editor, select a code snippet and click
in the upper-right corner of the Data Studio page. In the DataWorks Copilot chat window, enter your command and click Send. Wait for DataWorks Copilot to return the result.

Code error correction
DataWorks Copilot helps you search for and fix errors in a specified code snippet. You can also start DataWorks Copilot with a few clicks in the code editor to fix syntax errors. In the code editor, select a code snippet and right-click the code snippet to choose , enter your command, click Send, and then wait for DataWorks Copilot to return the result.


Code optimization
DataWorks Copilot allows you to optimize the selected SQL code. DataWorks Copilot helps you simplify the code logic, improve the code running efficiency, and reduce the load on your database. Click
in the upper-right corner of the Data Studio page. In the DataWorks Copilot chat window, enter /
. In the pop-up list, select Code Optimization. Enter the desired code snippet in the chat window, click Send, and then wait for DataWorks Copilot to return the result.

Code testing
DataWorks Copilot can generate a test solution and test code based on the selected SQL code. This helps you verify whether each part of the task code runs as expected. Click
in the upper-right corner of the Data Studio page. In the DataWorks Copilot chat window, enter /
. In the pop-up list, select Code Testing. Enter the desired code snippet in the chat window, click Send, and then wait for DataWorks Copilot to return the result.

Code Q&A
DataWorks Copilot provides interpretations of and usage examples for your proposed SQL syntax or MaxCompute functions to help deepen your understanding of the SQL syntax and functions. Click
in the upper-right corner of the Data Studio page. In the DataWorks Copilot chat window, enter your command and click Send. Wait for DataWorks Copilot to return the result.

Intelligent table creation
In the left-side navigation pane of the Data Studio page, click Data Catalog. In the DATA CATALOG pane, select a data catalog and create a table in the catalog. In the top toolbar of the page that appears, click Use Copilot to Create Table. On the page that appears, enter your command in the displayed field, click Send, and then wait for DataWorks Copilot to return the result.

Generation of intelligent charts and insights
In the left part of the SQL query result tab in DataAnalysis, click the chart icon. Click Copilot at the top and wait for DataWorks Copilot to return the result.

Description generation
When you create a user-defined function (UDF) in Data Studio, you must describe the functionality of the UDF and the code changes that you made to allow reviewers to understand the functionality of the UDF. In this case, you need to only click the Copilot icon in the lower-right corner of the description field. The LLM automatically generates a description for the UDF.
