MaxCompute Tunnel is a tunnel service for uploading data to and downloading data from MaxCompute. Data upload and download tools provided by MaxCompute are based on Tunnel SDK.
SDK interfaces
Tunnel SDK exposes two entry classes. Choose based on your use case:
| Interface | Type | Use when |
|---|---|---|
TableTunnel | Entry class | Uploading data to or downloading data from a MaxCompute table |
TableTunnel.UploadSession | Upload session | Writing data to a MaxCompute table |
TableTunnel.DownloadSession | Download session | Reading data from a MaxCompute table |
InstanceTunnel | Entry class | Downloading results from a MaxCompute SQL instance |
InstanceTunnel.DownloadSession | Download session | Reading results from a SQL instance that runs a SELECT query |
Use TableTunnel for bulk table data transfers. Use InstanceTunnel to download the results of a SELECT query from a SQL instance.
Both TableTunnel and InstanceTunnel support access over the Internet and over an internal network on Alibaba Cloud. Downloads over an internal network are free of charge.
Interface behavior varies by SDK version. See SDK Java Doc for the full API reference.
Add the SDK dependency
To use Tunnel SDK in a Maven project, add the following dependency to your pom.xml:
<dependency>
<groupId>com.aliyun.odps</groupId>
<artifactId>odps-sdk-core</artifactId>
<version>X.X.X-public</version>
</dependency>Replace X.X.X-public with the latest version. To find it, search for odps-sdk-core in the Maven repository.
What's next
To write data using the Java Database Connectivity (JDBC) driver instead of Tunnel SDK, see JDBC overview.
For endpoint URLs by region and network type, see Endpoints.