All Products
Search
Document Center

Dataphin:Manage notebook cells

Last Updated:Jul 31, 2026

A notebook cell is the basic building block for creating content in a notebook. By adding cells to a notebook, you can create and organize your content. Different cell types support different operations and features. This topic describes the use cases for each cell type and the actions they support.

Background information

For details 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 yet supported:

  • HTML

  • Definition Lists

  • Emoji

  • Highlight

  • Subscript

  • Superscript

Markdown cell

A markdown cell allows you to use standard Markdown syntax to add text content to your notebook.

image

Area

Description

Actions area

After you select a markdown cell, you can manage it in the Actions area. The available actions include Switch Cell, Add Cell, Copy Cell, Move Cell, and Delete Cell.

  • Switch Cell: Switch the current cell to another type, such as a markdown cell, a sql cell, or a database sql cell.

  • Add Cell: Add a new cell below the current markdown cell. For example, you can add a markdown cell, a sql cell, or a database sql cell.

  • Copy Cell: Duplicates the current markdown cell below it.

  • Move Cell: Moves the current markdown cell up or down.

  • Delete Cell: Deletes the current markdown cell.

Editing area

In the editing area, you can write notebook content using Markdown syntax. For more information, see Markdown syntax.

SQL cell

A sql cell allows you to add and run compute engine SQL in your notebook.

Note

For a Hadoop compute engine, when a Spark SQL cell creates a temporary table, the system uses the default storage format specified in Management Center > System Settings > Development Platform > Table Management Settings.

For example, if the default storage format in Table Management Settings is hudi, the system adds the using hudi statement when it creates a temporary table. If the default storage format is Engine Default, the temporary table is created with an unspecified storage format.

image

Area

Description

Actions area

After you select a sql cell, you can manage it in the Actions area. The available actions include Run, Query Acceleration, Collapse Cell, Format SQL, Switch Cell, Add Cell, Copy Cell, Move Cell, and Delete Cell.

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

  • Query Acceleration: MAXCOMPUTE_SQL, HIVE_SQL, IMPALA_SQL, and SPARK_SQL cells support query acceleration. After you enable query acceleration, you must select an acceleration method.

    • Acceleration source: Use an acceleration source for query acceleration. If you select this method, you must also select an acceleration source and a resource group.

      • Acceleration source: Select an acceleration source that is bound to the compute source of the current project. If no acceleration sources are available, click New acceleration source to create one.

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

      Note
      • If you use an acceleration source, the ad hoc query runs using the syntax of the selected acceleration source type. Ensure that your SQL statements comply with that syntax. For example, if the selected acceleration source type is StarRocks, the ad hoc query runs using StarRocks syntax.

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

    • MCQA: MaxCompute Query Acceleration (MCQA). Each tenant has limits on the number of jobs and concurrency for MCQA, which can cause acceleration failures 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.

    If the current tenant uses the MaxCompute compute engine:

    • If you have not purchased query acceleration but have enabled it in the Development Platform, the acceleration method is MCQA.

    • If you have purchased and enabled query acceleration in the Development Platform, but the compute source for the current project is not bound to an acceleration source, the acceleration method is MCQA.

    • If you have purchased query acceleration and the project's compute source is bound to an acceleration source, you can select either Acceleration source or MCQA as the acceleration method.

    If the current tenant uses the Hadoop compute engine: If you have purchased query acceleration and the project's compute source cluster is bound to an acceleration source, the acceleration method is Acceleration source.

  • Collapse Cell: Collapses the code area of the current sql cell.

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

  • Switch Cell: Switch the current sql cell to another type, such as a markdown cell, a sql cell, or a database sql cell.

    Note

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

  • Add Cell: Add a new cell below the current sql cell, such as a markdown cell, a sql cell, or a database sql cell.

  • Copy Cell: Duplicates the current sql cell below it.

  • Move Cell: Moves the current sql cell up or down.

  • Delete Cell: Deletes the current sql cell.

Editing area

You can develop compute engine SQL in the editing area.

Database SQL cell

A database sql cell allows you to add and run database SQL in your notebook.

image

Area

Description

Actions area

After you select a database sql cell, you can manage it in the Actions area. The available actions include Run, Collapse Cell, Format SQL, Switch Cell, Add Cell, Copy Cell, Move Cell, and Delete Cell.

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

    Note

    By default, a database sql cell runs using the default resource group of the selected data source, not the default resource group of the project.

  • Collapse Cell: Collapses the code area of the current database sql cell.

  • Format SQL: Formats 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, a sql cell, or a database sql cell.

  • Add Cell: Add a new cell below the current database sql cell, such as a markdown cell, a sql cell, or a database sql cell. For a list of data source types that database sql cells support, see Supported data sources.

  • Copy Cell: Duplicates the current database sql cell below it.

  • Move Cell: Moves the current database sql cell up or down.

  • Delete Cell: Deletes 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 the following data sources, you must select a database/schema: 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.

Editing area

You can develop database SQL in the editing area.

After you finish editing the database SQL code, you can click Run. The system parses all objects in the code and performs a permission check. If this check fails, a dialog box appears listing the objects for which the user lacks permissions.

The permission check failure dialog box displays the object name, object type, permission type, and available actions.

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

  • Object type: Table or global variable.

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

  • Actions: If the permission check fails, you can apply for permissions for one or more objects.

    • Apply for permissions on a single object: Click the image.png icon in the Actions column for an object to apply for permissions on it. The default validity period is 30 days.

    • Apply for permissions in batches: Select multiple objects or select Select All Tables, and then click Permission application.

    For more information about how to apply for permissions, see Apply for Permissions. After you obtain the permissions, run the cell again.

    Note

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