The data upload and download tools of MaxCompute, such as the MaxCompute client (odpscmd) and MaxCompute Studio, upload and download data by using MaxCompute Tunnel. This topic describes how to use Tunnel commands or Tunnel SDK to download data.
Prerequisites
- A MaxCompute project is created and MaxCompute is connected by using a tool. Note For more information about how to connect to MaxCompute, see Connect to MaxCompute.
- A table to which you want to upload data is created in the MaxCompute project.
Download data by using Tunnel commands in odpscmd
You can run the Tunnel download command to download MaxCompute table data or the query results of the specified instance to your local directory. You can download data from only one table or partition to a single local file at a time. For a partitioned table, you must specify the partition from which you want to download data. For a multi-level partitioned table, you must specify a lowest-level partition. For more information, see Download.
Download data by using Tunnel SDK in Studio
Tunnel SDK provides interfaces, such as TableTunnel, TableTunnel.UploadSession, TableTunnel.DownloadSession, InstanceTunnel, and InstanceTunnel.DownloadSession. For more information, see Tunnel SDK.
The usage of the SDK varies based on the SDK version. For more information, see SDK Java Doc.
TableTunnel and InstanceTunnel are the entry classes for accessing MaxCompute Tunnel.
TableTunnel: allows you to perform operations on the data of a table. For example, you can download the data of a table.
InstanceTunnel: allows you to perform operations on the results of an SQL statement. For example, you can download the results of a SELECT statement.
For more information about how to use Tunnel SDK to download data, see the following topics: