LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

odps

command-line client for Alibaba Cloud MaxCompute (ODPS)

TLDR

Start the interactive client
$ odps
copy
Execute a single SQL statement
$ odps -e "[SELECT * FROM table LIMIT 10;]"
copy
Run a SQL script file
$ odps -f [query.sql]
copy
Specify the target project and endpoint
$ odps --project [my_project] --endpoint [https://service.cn-shanghai.maxcompute.aliyun.com/api]
copy
Set output format to CSV
$ odps -e "[SELECT * FROM table;]" --format csv
copy

SYNOPSIS

odps [options]

DESCRIPTION

odps is the official command-line client for Alibaba Cloud's MaxCompute service (formerly Open Data Processing Service, abbreviated ODPS). It opens an interactive SQL prompt against a MaxCompute project where the user can run SQL queries, manage tables, partitions, resources, and functions, and submit MapReduce or Spark jobs.Non-interactive use is supported through -e for one-off statements and -f for SQL files, which is the common pattern in scheduled pipelines. The client reads endpoint URLs and credentials from conf/odps_config.ini so the same binary can target multiple regions by swapping configuration files.

PARAMETERS

-e SQL

Execute a single statement and exit. Multiple statements may be separated with semicolons.
-f FILE
Execute the SQL script read from FILE.
--project NAME
MaxCompute project to use for the session. Overrides the value in odps_config.ini.
--endpoint URL
MaxCompute service endpoint URL. Required when not set in the configuration file.
--access-id ID
Alibaba Cloud Access Key ID. Reads from odps_config.ini by default.
--access-key KEY
Alibaba Cloud Access Key Secret.
--format FORMAT
Output format: text (default), csv, json.
-r, --retry N
Number of times to retry a failed network call.
--help
Display usage information.

CAVEATS

Requires a valid Alibaba Cloud Access Key pair with permissions on the target MaxCompute project. Each statement consumes billable compute and storage resources. Endpoint URLs are region-specific; cross-region access is generally not permitted. Java 8 or later is required because the client is a Java JAR wrapped in a shell script.

HISTORY

The MaxCompute service launched as ODPS within Alibaba's internal infrastructure and was opened to public cloud customers around 2014. The client retained the odps name even after the service was rebranded as MaxCompute, so legacy scripts and documentation often refer to either name interchangeably.

SEE ALSO

Copied to clipboard
Kai