The MaxCompute Go SDK provides Go interfaces for operating and managing MaxCompute services, including project management, table manipulation, and data transfer.
Source code: github.com/aliyun/aliyun-odps-go-sdk
API reference: pkg.go.dev/github.com/aliyun/aliyun-odps-go-sdk
Get started
Complete these steps in order to set up the SDK and start making requests:
| Step | Description |
|---|---|
| 1. Install the Go SDK | Install the Go SDK package into your project. |
| 2. Configure access credentials | Set up a credential provider to authenticate requests. Alibaba Cloud uses these credentials to verify identity and access privileges. |
| 3. Initialize the MaxCompute SDK | Create an ODPS object, which is the entry point for all SDK operations. Access projects, tables, and instances through this object. |
Core operations
After setup, use the SDK for the following operations:
| Operation | Description |
|---|---|
| Execute SQL | Run MaxCompute SQL statements using the run method of the SQLTask object or the MaxCompute SQL Driver. |
| Upload and download data | Batch upload and download data for tables or partitions using the Tunnel. To write data in a streaming fashion, use the Streaming Tunnel. |
| Manage tables | Retrieve table metadata and delete tables. |
| Manage partitions | Retrieve partition information and delete partitions. |
| Manage instances | Monitor execution status and retrieve results from instance objects returned after SQL execution. |
| Manage permissions | Run permission management commands to control access to MaxCompute resources. |
| Logview | View and debug submitted MaxCompute jobs using Logview. |