Create Table

Last Updated: Aug 07, 2017

New table

Generally you need to create tables during data development to store data synchronization and processing results. ‘Alibaba Cloud Dataplus platform - Data Management’ provides two methods to create a table: visualized tabulation and statement-based tabulation.

Compared with the script-based tables by the Data Development module, tables created through the Data Management module support business category division. When there are numerous organizations or businesses, categorizing tables will facilitate metadata management.

Prepare permissions (prerequisite)

■ Real-name authentication of cloud account to generate the access ID and key. The cloud account used for the tabulation should be the account of the user currently logged in and must have an access ID and key to send tabulation requests to MaxCompute. Therefore, this cloud account must complete the real-name authentication to generate the access ID and key.

  1. Log in to Alibaba Cloud official website using the cloud account ;

  2. Go to My Center, and click at the top right corner to enter the new page, as shown in the figure below:

    1

  3. Click to apply for an Access ID and Access Key successfully .

    1

    ■ Grant tabulation permission to cloud accounts. You must grant the tabulation permission to the cloud account to use the account for table creation. MaxCompute project owners can directly run the authorization statement to authorize the permissions.

    1. use projectname; --Open the project
    2. add user aliyun$Cloud account; --Add a user
    3. grant CreateInstance,CreateTable,List ON PROJECT projectname TO aliyun$Cloud account; --Grant permissions to the user

    Note: Here the cloud account currently logged in is used for creating the table, so the table owner is the account currently logged in.

Visualized tabulation

  1. Access Data IDE Kit and go to the Console as a developer, click the Enter Work Zone of the corresponding project ;

  2. Click Data Management in the top menu bar and navigate to Manage Data Tables ;

  3. Click New Table ;

    1

  4. Fill in the basic information configuration items on the New Table page ;

    1

    The configuration items of the Basic Information interface of Visualized Tabulation are described as follows:

    ■ Project Name: The list shows the MaxCompute projects that the user is currently in.

    ■ Table Name: A table name may contain letters, numbers, and underscores.

    ■ Category: The category of the current table. Up to four category levels are supported. For details about the configuration of existing category navigation, see Category Navigation Configuration.

    ■ Description: A brief description of the current table.

    ■ Lifecycle: The lifecycle function of MaxCompute. Data in the table (or partition) that has not been updated within the period of time specified by “Lifecycle” (in the unit of days) will be cleared. Five options are available, including “1 day”, “7 days”, “32 days”, “Permanent”, and “User-defined”.

  5. Click Next ;

  6. Fill in the configuration items of the field and partition information on the New Table page ;

    a. Add the field information settings.

    b. Set the partition.

    1

    The configuration items on the Field and Partition Information interface of Visualized Tabulation are described as follows:

    ■ English Name of the Field: The English name of a field, which may contain letters, numbers, and underscores.

    ■ Field Type: The MaxCompute data type (string, bigint, double, datetime, or boolean).

    ■ Description: Detailed description of a field.

    ■ Action: The options include “Move Up”, “Move Down”, and “Delete”.

    ■ Whether to Set Partitions: If you select to set partitions, you need to configure the partitioning key information. The string and bigint data types are supported.

  7. Click Submit.

    After the newly created table is submitted successfully, the system will automatically jump back to the Manage Data Tables page. Click My Managed Tables and you will be able to see the newly created table.

Statement-based tabulation

  1. Go to Alibaba Cloud Dataplus platform > Data IDE Kit > Console as a developer, click Enter Work Zone in the action bar of the corresponding project ;

  2. Click Data Management in the top menu bar and navigate to Manage Data Tables ;

  3. Click New Table ;

  4. Click DDL Tabulation ;

  5. Enter the MaxCompute SQL tabulation statement ;

    1

    1. create table if not exists table2
    2. (
    3. id string commentUser ID’,
    4. name string commentUser name
    5. ) partitioned by(dt string)
    6. LIFECYCLE 7;
  6. Click Submit ;

    1

    Except Alias, Category, and Lifecycle, all the other configuration items on the Basic Information page are automatically filled in. You need to edit and provide the security levels of fields on the Field and Partition Information pages.

    1

  7. Fill in the configuration items on the Basic Information page of the newly created table ;

    1

  8. Click Next ;

  9. Click Submit .

    After the newly created table is submitted successfully, the system will automatically jump back to the Manage Data Tables page. Click My Managed Tables and you will be able to see the newly created table.

Thank you! We've received your feedback.