All Products
Search
Document Center

Dataphin:Create SQL queries based on the analysis platform

Last Updated:Jan 21, 2025

Dataphin's analysis platform offers an SQL query feature that enables the creation and execution of SQL queries to retrieve necessary data. It also facilitates visualization and analysis of query results.

Scenarios

Extract and Download Data: SQL queries can extract, aggregate, filter, and sort data from the compute source, with support for data download to aid in analysis and report creation.

Data Visualization: SQL queries enable the presentation of business data in chart form, aiding business users in intuitive data understanding and analysis for informed decision-making.

Overview of the SQL query development page

The SQL query development page features a SQL query folder, an editor menu, an editing area, and a console. This page facilitates the development and management of SQL queries.

The compute source for the project and the database SQL query areas are identical. The figure below illustrates this using the database SQL query as an example.

image.png

```markdown

Area

Description

SQL Query Directory

The SQL query directory includes two root directories: My and Shared With Me.

  • The My directory serves as the root for SQL queries you create, allowing for the organization of multiple subdirectories beneath it. You can manage your SQL queries within this directory. To create new SQL queries, see Create a new SQL query.

  • Shared With Me: This directory contains SQL queries shared with you by others, which you can view here.

SQL query tasks associated with the current account support copy, rename, move, and delete operations.

SQL Query Editor Menu

You can edit and manage your SQL queries through the SQL Query Editor Menu. This includes data source switching, query acceleration, run, save, share, parameter configuration, formatting, locate, project switching.

  • Data Source Switching: For an SQL query that utilizes a data source, you can change the active data source from the dropdown box when querying data.

  • Run: Execute selected SQL code by clicking Run or using the (Cmd+Enter) shortcut key.

  • Save: Click image..png to save the current editing content.

  • Share: Share your SQL query with other users within the Dataphin instance.

  • Query Acceleration: Supported when using MaxCompute as the offline compute engine, query acceleration can be enabled to utilize MaxCompute MCQA for faster query processing. However, MCQA is subject to job number and concurrency limitations per tenant, which could result in acceleration failures. For more information, see Query Acceleration (MCQA).

  • Parameter Configuration: Click image.png to set the values for SQL query parameters in the configuration dialog box. For more information, see Notebook Parameter Configuration.

  • Formatting: Format the SQL code within the query.

  • Locate: Click image..png to find the current SQL query within the SQL query directory.

  • Project Switching: Within the editor menu, you have the ability to switch the active project for the SQL query, which includes changing the compute source for the analysis platform.

    Note
    • The AccessKey for the compute engine in the selected active project must have the necessary access privileges for the project containing the query table; otherwise, the query will not succeed.

    • If your analysis platform is not linked to a default compute source, you can assign a dedicated compute source to it. This action is restricted to super administrators or system administrators. For detailed instructions, see Analysis platform settings.

    • Switching is only supported to the Dev or Basic project associated with the current account, which must be linked to an offline engine. Moreover, the account must possess the necessary ad hoc query execution permissions for the project. For more information, see Request, renew, and return table permissions.

Editing Area

Compose your SQL queries in the editing area to perform data queries.

④Console

Query results are displayed in the console after execution. You can view results, logs, code, and perform visual analytics here. Features include:

  • Running Results: Display column information for the results. Note that database SQL queries do not support saving results as temporary tables.

    Note

    Database SQL queries do not allow for the saving of query results into temporary tables.

    • Display Columns: Enables the display of column information corresponding to the execution results.

    • Single Row Details: View detailed information for a selected row from the execution results, including the row number, ordinal number, field name, and value.

    • Result Query: Search for a specific value within the execution results by entering the desired value.

    • Download Data: Click image.png to download the execution results as data files in CSV or Excel format.

      Note

      The format of the data file and the necessity for download approval are set by the Management Center under Data download. For more information, see Data download configuration .

    • Row and Column Transformation: Click image.png to toggle between row and column display modes for the execution results.

  • Visual analytics: Enables the display of running results as various graphical representations. It supports line charts, bar charts, pie charts, and more. For additional details, see SQL visual charts.

  • Logs: Provides a display of log information detailing the SQL query execution times.

  • Code: Shows the SQL query code for your reference.