Alibaba Cloud MaxCompute data source
Connect ApsaraDB for SelectDB to a MaxCompute data source to run federated queries across your data warehouse without moving data.
Use cases
| Use case | Description |
|---|---|
| Federated analysis | Query MaxCompute tables directly from SelectDB alongside your internal tables. |
Prerequisites
Before you begin, ensure that you have:
Enabled the open storage (Storage API) feature for MaxCompute. For setup steps and supported regions, see Tenant properties
A running ApsaraDB for SelectDB instance. See Connect to an instance
Create a MaxCompute catalog
Connect to your SelectDB instance.
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
| Parameter | Description |
|---|---|
type | Fixed value: max_compute. |
mc.region | The region where the MaxCompute project is located. |
mc.default.project | The name of the MaxCompute project. |
mc.access_key | Your AccessKey ID. To create one, see Create an AccessKey. |
mc.secret_key | Your AccessKey secret. |
mc.endpoint | The endpoint of the MaxCompute project's region. Required for ApsaraDB for SelectDB version 4.0 and later. See Choose an endpoint below. |
Optional parameters
| Parameter | Default | Description |
|---|---|---|
mc.public_access | false | Set to true when mc.endpoint is configured as an Internet endpoint. |
Choose an endpoint
Use a Virtual Private Cloud (VPC) endpoint whenever possible.
| Endpoint type | When to use | Requirement |
|---|---|---|
| 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 endpoint | Not 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.
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.