All Products
Search
Document Center

Dataphin:Manage Notebook cells

Last Updated:Sep 16, 2026

Notebook cells are the basic components for building content in a Notebook. You can add cells to a Notebook to create and organize content. Different types of cells support different operations and features. This topic describes the scenarios and management operations for each cell type.

Background information

For more information about the Markdown syntax supported in Markdown cells, see https://www.markdownguide.org/extended-syntax/ and https://www.markdownguide.org/basic-syntax/.

The following syntax is not supported:

  • HTML

  • Definition lists

  • Emoji

  • Highlight

  • Subscript

  • Superscript

Markdown cells

You can use Markdown cells to add text content to a Notebook using standard Markdown syntax.

image

Area

Description

Action area

After you select a Markdown cell, you can manage it in the action area. The operations include switching the cell type, adding a cell below the current one, copying the cell, moving the cell up, moving the cell down, and deleting the cell.

  • Switch cell: Switch the current Markdown cell to another type, such as a Markdown cell, SQL cell, or database SQL cell.

  • Add cell: Add another cell below the current Markdown cell, such as a Markdown cell, SQL cell, or database SQL cell.

  • Copy cell: Create a copy of the current Markdown cell with the same content below it.

  • Move cell: Move the current Markdown cell. You can move it up or down.

  • Delete cell: Delete the current Markdown cell.

Edit area

In the edit area, you can develop Notebook content using Markdown syntax. For more information about Markdown syntax, see Markdown Syntax.

SQL cells

You can use SQL cells to add and run compute engine SQL statements in a Notebook.

Note

For Spark SQL cells in a Hadoop compute engine, temporary tables are created using the default storage format specified in Management Center > System Settings > Development Platform > Table Management Settings.

For example, if the default storage format is set to hudi, the using hudi statement is added when a temporary table is created. If the default storage format is set to Engine Default, no specific storage format is used.

image

Area

Description

Action area

After you select an SQL cell, you can manage it in the action area. The operations include running SQL code, accelerating queries, collapsing the cell, formatting SQL, switching the cell type, adding a cell, copying the cell, moving the cell, and deleting the cell.

  • Run: Run the SQL code in the current SQL cell.

  • Query acceleration: Query acceleration is supported for MAXCOMPUTE_SQL, HIVE_SQL, IMPALA_SQL, and SPARK_SQL cells. After you enable query acceleration, select an acceleration method.

    Acceleration source: Accelerate queries using an acceleration source. If you select this method, you must also select an acceleration source and a resource group.

    • Acceleration source: Select an acceleration source attached to the current project's compute source. If no acceleration sources are active, click Create Acceleration Source to go to the creation page and create one as needed.

    • Resource group (optional): Select a configured resource group under the selected acceleration source.

    Note
    • If you select Acceleration source, the runtime executes the SQL statement based on the syntax of the selected source type. Make sure the SQL statement complies with the syntax rules. For example, if the acceleration source type is StarRocks, the ad hoc query job runs using StarRocks syntax.

    • When you use an acceleration source to accelerate queries, a temporary table is not created for each query.

    MCQA: Stands for MaxCompute MCQA query acceleration. Each tenant has limits on the number of jobs and concurrency for MCQA, which may cause acceleration to fail or execution errors. For more information, see Query Acceleration (MCQA). You can disable MCQA acceleration in Management Center > System Settings > Development Platform > Query Acceleration.

    The supported acceleration methods vary depending on the compute engine and scenario.

    When the current tenant uses a MaxCompute compute engine:

    • If you have not purchased a data query acceleration service but have enabled query acceleration on the development platform, the acceleration method is MCQA.

    • If you have purchased a data query acceleration service, enabled query acceleration on the development platform, and the compute source for the current project is not attached to an acceleration source, the acceleration method is MCQA.

    • If you have purchased a data query acceleration service and the compute source for the project is attached to an acceleration source, you can select either Acceleration source or MCQA.

    When the current tenant uses a Hadoop compute engine: If you have purchased a data query acceleration service and the cluster for the project's compute source is attached to an acceleration source, the acceleration method is Acceleration source.

  • Collapse cell: Collapse the code area of the current SQL cell.

  • Format SQL: Format the SQL code in the current SQL cell.

  • Switch cell: Switch the current SQL cell to another type, such as a Markdown cell, SQL cell, or database SQL cell.

    Note

    When the compute engine is attached to a Hive instance with Impala enabled, you can switch between Impala SQL and Hive SQL.

  • Add cell: Add another cell below the current SQL cell, such as a Markdown cell, SQL cell, or database SQL cell.

  • Copy cell: Create a copy of the current SQL cell with the same content below it.

  • Move cell: Move the current SQL cell. You can move it up or down.

  • Delete cell: Delete the current SQL cell.

Edit area

You can develop compute engine SQL in the edit area.

Database SQL cells

You can use Database SQL cells to add and run database SQL statements in a Notebook.

image

Area

Description

Action area

After you select a database SQL cell, you can manage it in the action area. The operations include running database SQL code, collapsing the cell, formatting SQL, switching the cell type, adding a cell, copying the cell, moving the cell, and deleting the cell.

  • Run: Run the SQL code in the current database SQL cell.

    Note

    The database SQL runtime uses the default resource group configured in the selected data source, not the default resource group of the analysis project.

  • Collapse cell: Collapse the code area of the current database SQL cell.

  • Format SQL: Format the SQL code in the current database SQL cell.

  • Switch cell: Switch the current database SQL cell to another type, such as a Markdown cell, SQL cell, or database SQL cell.

  • Add cell: Add another cell below the current database SQL cell, such as a Markdown cell, SQL cell, or database SQL cell. For more information about the data source types supported by database SQL cells, see Supported data sources for the analysis platform.

  • Copy cell: Create a copy of the current database SQL cell with the same content below it.

  • Move cell: Move the current database SQL cell. You can move it up or down.

  • Delete cell: Delete the current database SQL cell.

  • Select data source: Select a data source (including external data sources) to execute the SQL code.

  • Catalog: For Presto and Trino data sources, you must select a Catalog.

  • Database/Schema: For MySQL, PostgreSQL, Hologres, AnalyticDB for PostgreSQL, OceanBase (Oracle tenant mode), Lindorm, Oracle, ClickHouse, DM, openGauss, StarRocks, Doris, SelectDB, Presto, GaussDB (DWS), Trino, PolarDB-X 2.0, OushuDB, TDSQL for MySQL, and TDSQL for PostgreSQL data sources, you must select a Database/Schema.

Edit area

You can develop database SQL in the edit area.

After you finish editing the database SQL code, click Run. The system parses all objects in the code to confirm if the current user has the required operation permissions. If the permission verification succeeds, the user has the necessary permissions for the checked objects. If the permission verification fails, the user does not have the required permissions. An access denied dialog box appears showing a list of objects for which the user lacks permissions.

The access denied dialog box displays the object name, object type, permission type, and operation information.

  • Object name: The name of the object for which you lack permissions.

  • Object type: Table and global variable.

  • Permission type: The permissions required to run the script. For data source tables, only table query permission is needed. For data sources, only execution permission is needed.

  • Operation: If checking the object fails, you can request permissions for one or more objects.

    • Single-object permission request: Click the image.png icon in the Actions column of the target object to request personal permissions for the object's permission points. The default validity period is 30 days.

    • Request permissions in batch: Select multiple objects or select Select all tables, and then click Request Permission.

    For more information about how to request permissions, see Request permissions. After you are granted the permissions, you can run the code again.

    Note

    Only MySQL and Oracle data sources support table-level permission control.