All Products
Search
Document Center

MaxCompute:Tunnel operations

Last Updated:Mar 26, 2026

MaxCompute uses Tunnel to upload and download data. This topic describes how to use Tunnel to perform these operations.

MaxCompute allows you to run Tunnel commands to upload and download data. For a full list of Tunnel commands, see Tunnel commands.

OperationDescriptionRequired permissionTool
Upload dataUploads local data to a MaxCompute table in append modeAlter on the destination tableMaxCompute client (odpscmd)
Download dataDownloads table data or instance execution results to your local machineSelect on the source tableMaxCompute client (odpscmd)

Upload data

Uploads local data to a MaxCompute table in append mode. Uploading data to MaxCompute is free of charge.

Limits

  • Upload files or level-1 directories to only one table or one partition per operation.

  • For a partitioned table, specify the target partition. If the table has multiple partition levels, specify a lowest-level partition.

Syntax

Tunnel upload <path> [<project_name>.]<table_name>[/<pt_spc>];

Parameters

ParameterRequiredDescription
pathYesPath to the local data file. Default file format: TXT.
project_nameNoName of the project that owns the destination table. Required for cross-project access.
table_nameYesName of the destination table.
pt_spcNoPartition specification for partitioned tables. Format: partition_col1=col1_value1, partition_col2=col2_value1.... Must point to a lowest-level partition.

Path formats by OS

OSPath format
Windows (file in bin directory)File name.extension
Windows (file in another directory)D:\test\File name.extension
macOSAbsolute path required. Example: /Users/username/MaxCompute/bin/file name.extension

Examples

Example 1: Upload to a non-partitioned table

Upload log.txt (in the MaxCompute client bin directory) to test_table in the current project:

Tunnel upload log.txt test_table;

Example 2: Upload to a partitioned table across projects (Windows)

Upload log.txt from D:\test\ to the p1="b1",p2="b2" partitions of test_table in test_project:

Tunnel upload D:\test\log.txt test_project.test_table/p1="b1",p2="b2";

Download data

Downloads MaxCompute table data or the execution results of a specified instance to a directory on your local machine.

Important

Downloads are charged based on the amount of data transferred. Fee = data downloaded (GB) x USD 0.1166/GB. Data can only be downloaded over the Internet.

Limits

  • Download data from only one table or one partition to a single local file per operation.

  • For a partitioned table, specify the source partition. If the table has multiple partition levels, specify a lowest-level partition.

Syntax

Tunnel download [<project_name>.]<table_name>[/<pt_spc>] <path>;

Parameters

ParameterRequiredDescription
project_nameNoName of the project that owns the source table. Required for cross-project access.
table_nameYesName of the source table.
pt_spcNoPartition specification for partitioned tables. Format: partition_col1=col1_value1, partition_col2=col2_value1.... Must point to a lowest-level partition.
pathYesPath for the downloaded file on your local machine. Default file format: TXT.

Examples

Example 1: Download to the MaxCompute client directory

Download data from the p1="b1",p2="b2" partitions of test_project.test_table to test_table.txt in the MaxCompute client bin directory:

Tunnel download test_project.test_table/p1="b1",p2="b2" test_table.txt;

Example 2: Download to a custom directory (Windows)

Download the same partitioned data to D:\test\test_table.txt:

Tunnel download test_project.test_table/p1="b1",p2="b2" D:\test\test_table.txt;