Header comments for computing tasks

Updated at:

This topic describes how to customize the header comments automatically added when you create a computing task.

Supported computing tasks for each computing engine

  • The editable SQL computing task types depend on the offline computing engine used by your tenant.

  • Flink SQL and Flink DataStream tasks are independent of the offline computing engine. You can edit these tasks if a real-time computing engine is bound to your tenant.

  • Shell, Python, and Virtual tasks are independent of any computing engine.

Task type

Engine type

Hive SQL

E-MapReduce 3.x, E-MapReduce 5.x, CDH 5.x, CDH 6.x, Cloudera Data Platform 7.x, Huawei FusionInsight 8.x, and AsiaInfo DP5.3

Inceptor SQL

Transwarp TDH 6.x and Transwarp TDH 9.3.x

Spark SQL

E-MapReduce 3.x, E-MapReduce 5.x, CDH 5.x, CDH 6.x, Cloudera Data Platform 7.x, Huawei FusionInsight 8.x, AsiaInfo DP5.3, and Lindorm (computing engine)

Impala SQL

E-MapReduce 3.x, E-MapReduce 5.x, CDH 5.x, CDH 6.x, Cloudera Data Platform 7.x, Huawei FusionInsight 8.x, and AsiaInfo DP5.3

MaxCompute SQL

MaxCompute

ArgoDB SQL

ArgoDB

AnalyticDB for PostgreSQL SQL

AnalyticDB for PostgreSQL

StarRocks SQL

StarRocks

GaussDB SQL

GaussDB (DWS)

Databricks SQL

Databricks

Doris SQL

Doris

SelectDB SQL

SelectDB

Spark on Yarn

E-MapReduce 3.x, E-MapReduce 5.x, CDH 5.x, CDH 6.x, Cloudera Data Platform 7.x, Huawei FusionInsight 8.x, and AsiaInfo DP5.3

Spark on MaxCompute

MaxCompute

MapReduce on Yarn

E-MapReduce 3.x, E-MapReduce 5.x, CDH 5.x, CDH 6.x, Cloudera Data Platform 7.x, Huawei FusionInsight 8.x, and AsiaInfo DP5.3

MapReduce on MaxCompute

MaxCompute

Flink SQL, Flink DataStream

Independent of offline computing engines. Requires a bound real-time computing engine.

Shell, Python, Virtual

Independent of any computing engine.

Procedure

  1. In the top navigation bar of the Dataphin homepage, choose Management Center > Specification Settings.

  2. In the left-side navigation pane, choose Development Specification > Header Comments for Computing Tasks.

  3. Click Edit to customize the header comments for each computing task type supported by your tenant's computing engine. For details about the default comments for each task type, see Default header comments.

    You can use the following system variables:

    • ${author}: The username of the user logged in when the computing task is created.

    • ${createTime}: The creation time of the computing task. The format is yyyy-MM-dd HH:mm:ss.

    • ${taskType}: The computing task type, matching the name in the creation menu.

    • ${dbType}: The database type selected when you create a Database SQL task. It matches the selection in the database type drop-down list.

    • ${comment}: The description entered when creating the task.

  4. After you finish editing, click Save.

Default header comments

SQL

  • In a Simplified Chinese environment, the default value is as follows.

    —${taskType}
    --********************************************************************--
    -- Subject: The associated data domain or business scenario, such as the trading data domain or operational data reports.
    -- Description: A description of the data, such as its content and statistical granularity.
    -- Author: ${author}
    -- Created: ${createTime}
    -- Modification History
    -- Date       Modifier   Comment
    -- yyyymmdd     name     your comments here
    --********************************************************************--
  • The default value is empty in Traditional Chinese and English environments.

Python

The default value is the same in Simplified Chinese, Traditional Chinese, and English environments.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################
# Author: ${author}
# Created Time: ${createTime}
################################################
#===============================================

For Python computing tasks with Databricks Connect enabled, the following is the default comment for Simplified Chinese, Traditional Chinese, and English environments.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################
# Author: ${author}
# Created Time: ${createTime}
################################################
#===============================================
# Databricks Connect is enabled, and the 'spark' session is pre-configured.
# spark = DatabricksSession.builder.getOrCreate()
# The 'spark' session is created based on the Databricks cluster that is configured for the project's computing engine.
# You can disable Databricks Connect or change the cluster in Properties > Databricks Connect.

Database SQL

  • In a Simplified Chinese environment, the default value is as follows.

    —Database SQL
    --********************************************************************--
    -- You can use -- @@dataphin_sql_begin <statement> -- @@dataphin_sql_end to declare a standalone, complete SQL statement.
    -- Subject: The associated data domain or business scenario, such as the trading data domain or operational data reports.
    -- Description: A description of the data, such as its content and statistical granularity.
    -- Author: ${author}
    -- Created: ${createTime}
    -- Modification History
    -- Date       Modifier   Comment
    -- yyyymmdd     name     your comments here
    --********************************************************************--
  • The default value is empty in Traditional Chinese and English environments.

Flink SQL

  • In a Simplified Chinese environment, the default value is as follows.

    --Stream SQL
    --********************************************************************--
    -- Author: ${author}
    -- Created: ${createTime}
    -- Comment: ${comment}
    --********************************************************************--
  • The default value is empty in Traditional Chinese and English environments.

Flink DataStream

  • In a Simplified Chinese environment, the default value is as follows.

    #DataStream 
    #********************************************************************--
    # Author: ${author}
    # Created: ${createTime}
    # Comment: ${comment}
    #********************************************************************--
  • The default value is empty in Traditional Chinese and English environments.

Others

For all other computing task types, the default header comments are empty in Simplified Chinese, Traditional Chinese, and English environments.