After you create a MaxCompute project, you must enter the project to perform subsequent development, analysis, and O&M operations. This topic describes common operations on projects, such as enter or view a project, and how to configure or view its project-level attributes.

The following table describes common statements that are used for project operations.
Operation Description Role Operation platform
Enter a project Enters a project on which you have access permissions. Users who have project access permissions You must execute the statements described in this topic on the MaxCompute client.
View the properties of a project Views the properties of a project. Project owner
Configure project properties Sets the properties of a project. Project owner
View account systems of a project Queries the information of the account system supported in the current project. Project owner
Add the RAM account system Adds the Resource Access Management (RAM) account system for the current project. Project owner
Remove the RAM account system Removes the RAM account system of the current project. Project owner

Usage notes

  • A project is not a workspace. To obtain a project name, log on to the MaxCompute console and view the names in the MaxCompute Project Name column on the Project management tab.
  • You cannot run commands to create or delete projects in MaxCompute. For more information about how to create a project, see Create a project.

Enter a project

Enters a specified project on which you have access permissions. After you enter the project, you can manage all objects in the project.

  • Syntax
    use <project_name>;
  • Parameter

    project_name: the name of the project that you want to access. If the project does not exist or you do not have access permissions on the project, an error is returned.

  • Examples
    • Example 1: Enter a specified project and access objects in the project.
      -- The current project is my_project, and the project that you want to enter is my_project_test. You have access permissions on the my_project_test project.
      odps@ my_project>use my_project_test;
      -- Query the test_src table in the my_project_test project.
      odps@ my_project_test>select * from test_src;
      MaxCompute automatically searches for the test_src table in the my_project_test project. If the table exists, data in the table is returned. If the table does not exist, an error is returned.
    • Example 2: Specify the name of the project that you want to access when you access the objects in the project from another project.
      -- Access the test_src table in the my_project2 project from the my_project_test project.
      odps@ my_project_test>select * from my_project2.test_src;

View the properties of a project

Views the project-level properties of the current project. MaxCompute also allows you to view the session-level properties of a project. For more information, see SET operations.

  • Syntax
    setproject;
  • Properties
    The following table describes common project properties.
    Property (KEY) Description Valid value (VALUE)
    odps.sql.allow.fullscan Specifies whether to allow a full table scan on a project. A full table scan occupies a large number of resources, which reduces data processing efficiency. Therefore, we recommend that you do not enable this feature.
    • True: A full table scan is enabled.
    • False: A full table scan is disabled.
    odps.table.lifecycle Specifies whether to configure a lifecycle for tables in a project.
    • Optional: The lifecycle clause is optional in a table creation statement. If you do not configure a lifecycle for a table, the table does not expire.
    • Mandatory: The lifecycle clause is required in a table creation statement.
    • Inherit: If you do not configure a lifecycle for a table when you create the table, the value of odps.table.lifecycle.value is used as the lifecycle of the table.
    odps.table.lifecycle.value The lifecycle of a table. Unit: days. Valid values: 1 to 37231. Default value: 37231.
    odps.security.ip.whitelist A whitelist of IP addresses that are authorized to access the project in the classic network. For more information, see Configure IP address whitelists. A list of IP addresses separated by commas (,)
    odps.security.vpc.whitelist A whitelist of IP addresses that are authorized to access the project in a specified VPC. For more information, see Configure IP address whitelists. RegionID_VPCID[IP Address]
    READ_TABLE_MAX_ROW The maximum number of data records that can be returned by a SELECT statement. Valid values: 1 to 10000. Default value: 10000.
    odps.sql.type.system.odps2 Specifies whether to enable the MaxCompute V2.0 data type edition. For more information about the MaxCompute V2.0 data type edition, see MaxCompute V2.0 data type edition.
    • True: The MaxCompute V2.0 data type edition is enabled.
    • False: The MaxCompute V2.0 data type edition is disabled.
    odps.sql.hive.compatible Specifies whether to enable the Hive-compatible data type edition. MaxCompute supports Hive syntax, such as inputRecordReader, outputRecordReader, and Serde, only after the Hive-compatible data type edition is enabled. For more information about the Hive-compatible data types, see Hive-compatible data type edition.
    • True: The Hive-compatible data type edition is enabled.
    • False: The Hive-compatible data type edition is disabled.
    odps.sql.decimal.odps2 Specifies whether to enable DECIMAL(precision,scale) in the MaxCompute V2.0 data type edition. For more information, see MaxCompute V2.0 data type edition.
    • True: DECIMAL(precision,scale) in the MaxCompute V2.0 data type edition is enabled.
    • False: DECIMAL(precision,scale) in the MaxCompute V2.0 data type edition is disabled.
    odps.sql.metering.value.max The upper limit on resources consumed by an SQL statement. For more information, see Consumption control. None.

Configure project properties

Configures the project-level properties of a project. This statement takes effect within 5 minutes. Check the result 5 minutes after the statement is executed successfully. MaxCompute also allows you to set session-level properties for a project. For more information, see SET.

  • Syntax
    setproject <KEY>=<VALUE>;
  • Parameters
    • KEY: the name of the property.
    • VALUE: the value of the property. For more information about properties, see View project properties.
  • Example
    Enable a full table scan for a project.
    setproject odps.sql.allow.fullscan=true;

View account systems of a project

Views the information of the account systems supported by the current project.

Syntax:
list accountproviders;
Note By default, MaxCompute identifies only the Alibaba Cloud account system. It cannot identify the RAM account system.

Add the RAM account system

Adds the RAM account system for the current project.

Syntax:
add accountprovider ram;

Remove the RAM account system

Removes the RAM account system.

Syntax:
remove accountprovider ram;