All Products
Search
Document Center

Dataphin:Manage notebook cells

Last Updated:Sep 30, 2025

Notebook cells are the basic components used to build 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 your Notebook using standard Markdown syntax.

image

Area

Description

Operation area

After you click and select a Markdown cell, you can manage it in the operation 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: Change the position of the current Markdown cell. You can move it up or down.

  • Delete Cell: Delete the current Markdown cell.

Editing area

In the editing area, use Markdown syntax to develop your Notebook content. 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, the default storage format specified in Management Center > System Settings > Developer Platform > Table Management Settings is used when you create a temporary table.

For example, if the default storage format is set to hudi, the using hudi statement is added when you create a temporary table. If the default storage format is set to Engine Default, the storage format is not specified when you create a temporary table.

image

Area

Description

Operation area

After you click and select an SQL cell, you can manage it in the operation 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: MAXCOMPUTE_SQL, HIVE_SQL, IMPALA_SQL, and SPARK_SQL cells support query acceleration. After you enable query acceleration, select an acceleration method.

    MCQA is MaxCompute Query Acceleration. For each tenant, MCQA has limits on the number of jobs and concurrency, which may cause acceleration failures or execution errors. For more information, see Query Acceleration (MCQA). You can disable MCQA acceleration in Management Center > System Settings > R&D Platform > Query Acceleration.

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

    If the current tenant uses a MaxCompute compute engine:

    • If you have not purchased query acceleration but have enabled query acceleration on the developer platform, the acceleration method is MCQA.

    • If you have purchased query acceleration, enabled it on the developer platform, but have not attached an acceleration source to the project's compute source, the acceleration method is MCQA.

  • 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

    If 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: Change the position of the current SQL cell. You can move it up or down.

  • Delete Cell: Delete the current SQL cell.

Editing area

Develop compute engine SQL in the editing area.

Database SQL cells

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

image

Area

Description

Operation area

After you click and select a database SQL cell, you can manage it in the operation 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 by default, 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. Database SQL cells support MySQL, AnalyticDB for PostgreSQL, AnalyticDB for MySQL 2.0, AnalyticDB for MySQL 3.0, Oracle, Presto, PostgreSQL, StarRocks, ClickHouse, GaussDB (DWS), Doris, SelectDB, Microsoft SQL Server, Hologres, openGauss, DM, and OceanBase.

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

  • Move Cell: Change the position of 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 data sources, you must select a catalog.

  • Schema: For AnalyticDB for PostgreSQL, Oracle, Presto, GaussDB (DWS), Microsoft SQL Server, Hologres, openGauss, DM, and OceanBase (Oracle tenant mode) data sources, you must select a schema.

Editing area

Develop database SQL in the editing area.

After you finish editing the database SQL code, click Run. The system parses all objects in the code to confirm whether the current user has the required operation permissions for the objects. If the permission verification is successful, the user has the necessary permissions. If the permission verification fails, the user does not have the required permissions, and a list of objects for which the user lacks permissions is displayed in a dialog box.

The permission verification failed 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 a data source table, only the permission to query table data is required. For a data source, only the execute permission is required.

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

    • Request permissions for a single object: In the Actions column of the target object, click the image.png icon to request personal permissions for that object. The default validity period is 30 days.

    • Request permissions in batches: 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 the permissions are granted, you can run the code again.

    Note

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