All Products
Search
Document Center

Dataphin:Manage notebook cells

Last Updated:Mar 05, 2025

Notebook cells are essential for constructing and organizing content within a notebook. They support a variety of operations and features, each tailored to specific types of content. This topic describes the use cases for each type of cell and the management operations they support.

Background information

The current Markdown cells support Markdown syntax. For more information, see the extended syntax guide and the basic syntax guide.

The following syntax is not supported:

  • HTML

  • Definition Lists

  • Emoji

  • Highlight

  • Subscript

  • Superscript

Markdown cells

Markdown cells enable you to incorporate text content into a notebook using standard Markdown syntax.

image

Area

Description

Operation area

After clicking to select the added Markdown cell, you can manage the Markdown cell in the operation area. This includes switching cells, adding cells under the current cell, copying cells, moving cells up, moving cells down, and deleting cells.

  • Switch Cell: Switch the current Markdown cell to another cell. For example, Markdown cell, SQL cell, database SQL cell.

  • Add Cell: Add another cell under the current Markdown cell. For example, Markdown cell, SQL cell, database SQL cell.

  • Copy Cell: Copy a Markdown cell with the same content under the current Markdown cell.

  • Move Cell: Move the position of the current Markdown cell. Supports moving up and down.

  • Delete Cell: Delete the current Markdown cell.

Editing area

In the editing area, you can develop notebook content using Markdown syntax. For Markdown syntax, please refer to Markdown syntax.

SQL cells

SQL cells allow you to input and execute compute engine SQL queries using SQL syntax within a notebook.

image

Area

Description

Operation area

After clicking to select the SQL cell, you can manage the SQL cell in the operation area. This includes running SQL code, query acceleration, collapsing cells, formatting SQL, switching cells, adding cells, copying cells, moving cells, and deleting cells.

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

  • Query Acceleration: When the project's compute engine in the current notebook is MaxCompute, query acceleration is supported. After enabling query acceleration, MaxCompute MCQA will be used to accelerate queries. MCQA has limitations on the number of jobs and concurrency for each tenant, which may cause acceleration to fail and execution errors. For more information, see Query Acceleration (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 cell. For example, Markdown cell, SQL cell, database SQL cell.

    Note

    When the compute engine is attached to Hive with Impala enabled, Impala SQL and Hive SQL can be switched mutually.

  • Add Cell: Add another cell under the current SQL cell. For example, Markdown cell, SQL cell, database SQL cell.

  • Copy Cell: Copy a SQL cell with the same content under the current SQL cell.

  • Move Cell: Move the position of the current SQL cell. Supports moving up and down.

  • Delete Cell: Delete the current SQL cell.

Editing area

You can develop compute engine SQL in the editing area.

Database SQL cells

Database SQL cells facilitate the addition and execution of database SQL queries using SQL syntax in a notebook.

image

Area

Description

Operation area

After clicking to select the database SQL cell, you can manage the database SQL cell in the operation area. This includes running database SQL code, collapsing cells, formatting SQL, switching cells, adding cells, copying cells, moving cells, and deleting cells.

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

  • 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 cell. For example, Markdown cell, SQL cell, database SQL cell.

  • Add Cell: Add another cell under the current database SQL cell. For example, Markdown cell, SQL cell, database SQL cell. Database SQL cells support selecting MySQL, AnalyticDB for PostgreSQL, AnalyticDB for MySQL 2.0, AnalyticDB for MySQL 3.0, Oracle, Presto, PostgreSQL, StarRocks, ClickHouse, GaussDB (DWS), Doris, SelectDB.

  • Copy Cell: Copy a database SQL cell with the same content under the current database SQL cell.

  • Move Cell: Move the position of the current database SQL cell. Supports moving up and down.

  • Delete Cell: Delete the current database SQL cell.

  • Select data source: Select the data source for executing SQL code.

  • Catalog: Presto data sources need to select a catalog.

  • Schema: AnalyticDB for PostgreSQL, Oracle, Presto, GaussDB (DWS) data sources need to select a schema.

Editing area

You can develop database SQL in the editing area.

After completing the database SQL code editing, you can click Run. The system will parse all objects in the code to confirm whether the current user has the permission to operate the objects. If the permission verification is successful, it indicates that the current operating user has the corresponding permission to check the objects. If the permission verification fails, it indicates that the current operating user does not have the permission for the corresponding objects, and the list of objects without permission will be displayed in the permission verification failed dialog box.

The permission verification failed dialog box will display the object name, object type, permission type, and operation information.

  • Object name: The name of the object without permission.

  • Object type: Table and global variable.

  • Permission type: The permissions required for this script execution. The data source table only has database permission. The data source only has execution permission.

  • Operation: If the object check fails, you can request permission for a single or multiple objects.

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

    • Batch permission request: Select multiple objects or select Select All Tables and then click Request Permission.

    For specific operations on requesting permission, see Request permission. After obtaining permission, you can rerun.

    Note

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