Note:
Estimated time: 5 minutes
Learning objectives: Start from scratch with DataBuddy, run a SQL query successfully, and build a minimal viable understanding of the platform.
This tutorial is the first lesson for getting started with DataBuddy. You can see the result of your first SQL query within 5 minutes as long as the following prerequisites are met.
Scenario Introduction
Whether you are a data analyst, data engineer, or data scientist, your first experience with DataBuddy should be smooth: log in, go to Studio, write a line of SQL, and see the result. This tutorial walks you through this minimal path, providing a consistent starting point for subsequent role-based tutorials (data engineer, data analyst, data governance, and Ops).
Prerequisites
Have a Tencent Cloud account and have activated the DataBuddy service.
The current account must have at least the Workspace Member role or higher in a workspace. If you do not have the required permissions, contact the workspace administrator to grant them. For more information, see Member and Permission Management. The current workspace is bound to an available interactive cluster or job cluster. If the workspace is not bound yet, ask the administrator to refer to Create Compute Resources. Note:
If you are a workspace administrator, this tutorial also verifies whether the account, workspace, and compute resources are ready, serving as a smoke test for workspace initialization.
Step 1: Entering the DataBuddy Console
1. Access the DataBuddy Workbench entry in a browser. After logging in with your Tencent Cloud account, you will be taken directly to the DataBuddy Workbench. 2. Select the target workspace and click Enter Workspace.
Step 2: Entering the Studio
1. Open Development Workbench in the left sidebar to go to the target studio.
2. Click + Create in the upper right corner of the page to create a new folder for storing subsequent files. Name it <YourEnglishName>_quickstart (for example, alice_quickstart).
Step 3: Creating a SQL File
1. Go to the folder, click + Create in the upper right corner, select New SQL, and name it hello.sql.
2. Double-click hello.sql to open it in the editor.
Step 4: Completing Execution Configuration
The three dropdowns in the SQL editor's top toolbar are required before running:
|
Default Catalog | Select the target Catalog (the Catalog bound to your workspace is automatically populated by default). |
Default Schema | Select an available Schema under the selected Catalog. |
Compute Resource | Select a running compute resource (such as default-spark-engine). |
Note:
SQL cannot run if any of the three items is not configured. If a dropdown is empty, the workspace has not been bound to a compute resource. Contact the workspace administrator.
Step 5: Writing and Running Your First SQL
1. Enter the following content in the editor:
-- Verify connectivity
SELECT 1 AS hello, current_timestamp() AS now;
2. Press Ctrl + Enter (⌘ + Enter for Mac users), or click the Run button in the toolbar.
The execution progress appears at the bottom of the page. After a few seconds, the Results tab is displayed, showing a row of returned values:
Congratulations! Your first SQL query has been executed in the compute engine.
Step 6: Understanding the Results Panel
The bottom panel contains three tabs:
|
Result | Presents query results in a table format and supports search, sorting, column locking, field settings, copying, and downloading. |
Log | Complete execution logs for locating failure causes, and supports keyword search and download. |
Code | Metadata such as the SQL actually submitted to the engine (with parameters expanded), query ID, runtime, and number of scanned rows, for easier troubleshooting of parameter issues. |
Verification Result
After completing all steps, you should see:
The file <EnglishName>_quickstart/hello.sql exists in the file tree on the left.
The default Catalog, default Schema, and compute resource at the top of the editor are configured.
The Results tab contains one row of returned values.
You can view logs for the three stages of SQL submission, execution, and completion on the Logs tab.
FAQs
What Should I Do If "Compute Resource Is Not Bound to the Workspace" Is Displayed When SQL Is Executed?
No compute resource is bound to the current workspace. Contact the workspace administrator to bind an interactive cluster in Creating Compute Resources, and then enter Studio again. What Should I Do If the Studio Remains in the "Starting" State?
Wait for 2 to 3 minutes. If it still has not started, refresh the page to enter again. If the problem persists, your personal environment quota may be exhausted. Contact the workspace administrator for assistance.
What Should I Do If No Data Source or Engine Is Available for SQL Execution?
This indicates that the current account has insufficient permissions in the workspace, or no compute resource is bound to the workspace. Check your role (see Member and Permission Management). Summary
In this tutorial, you have completed:
Log in to Tencent Cloud and enter the DataBuddy workspace.
Start the Studio personal runtime environment.
Create a SQL file, configure the execution environment, and run your first SQL query.
You have understood the purposes of the three panels: Results, Logs, and Code Information.