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

MaxCompute SQL

MaxCompute

Spark on MaxCompute

MaxCompute

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}
################################################
#===============================================

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.