Alibaba Cloud MaxCompute data source

Updated at:

Connect ApsaraDB for SelectDB to a MaxCompute data source to run federated queries across your data warehouse without moving data.

Use cases

Use caseDescription
Federated analysisQuery MaxCompute tables directly from SelectDB alongside your internal tables.

Prerequisites

Before you begin, ensure that you have:

Create a MaxCompute catalog

  1. Connect to your SelectDB instance.

  2. Run the following SQL statement to create a catalog. Replace the placeholder values with your actual configuration.

    CREATE CATALOG mc PROPERTIES (
      "type"               = "max_compute",
      "mc.region"          = "cn-beijing",
      "mc.default.project" = "<your-project>",
      "mc.access_key"      = "<your-accesskey-id>",
      "mc.secret_key"      = "<your-accesskey-secret>",
      "mc.endpoint"        = "https://service.cn-beijing-vpc.maxcompute.aliyun-inc.com/api"
    );

Required parameters

ParameterDescription
typeFixed value: max_compute.
mc.regionThe region where the MaxCompute project is located.
mc.default.projectThe name of the MaxCompute project.
mc.access_keyYour AccessKey ID. To create one, see Create an AccessKey.
mc.secret_keyYour AccessKey secret.
mc.endpointThe endpoint of the MaxCompute project's region. Required for ApsaraDB for SelectDB version 4.0 and later. See Choose an endpoint below.

Optional parameters

ParameterDefaultDescription
mc.public_accessfalseSet to true when mc.endpoint is configured as an Internet endpoint.

Choose an endpoint

Use a Virtual Private Cloud (VPC) endpoint whenever possible.

Endpoint typeWhen to useRequirement
VPC endpoint (recommended)Standard use — lower latency, no egress charges, more secure.The SelectDB instance and the MaxCompute project must be in the same region.
Internet endpointNot recommended for production environments due to security risks and limited bandwidth.Configure an Internet NAT gateway and set "mc.public_access" = "true".

For a list of available endpoints by region, see Endpoints.

Note

The pay-as-you-go quota for MaxCompute has limits on concurrent queries and resource usage. To increase your quota, see Computing resources - Quota management.

Column type mapping

The column type mapping for MaxCompute follows the same rules as the Hive catalog. For the full mapping table, see Hive data source.