LinuxCommandLibrary

odps

Dump files in octal or other formats

TLDR

Start the command-line with a custom configuration file

$ odpscmd --config=[odps_config.ini]
copy

Switch current project
$ use [project_name];
copy

Show tables in the current project
$ show tables;
copy

Describe a table
$ desc [table_name];
copy

Show table partitions
$ show partitions [table_name];
copy

Describe a partition
$ desc [table_name] partition ([partition_spec]);
copy

SYNOPSIS

odps subcommand [options] [arguments]
odps help [subcommand]
odps sql -e "SQL_STATEMENT"
odps upload local_path table_name

PARAMETERS

sql
    Executes MaxCompute SQL statements. Supports interactive mode or direct execution via -e option.

desc (or describe)
    Displays detailed information about a MaxCompute object (table, view, function, project).

ls (or list)
    Lists objects within the current MaxCompute project (tables, projects, instances, resources).

cat
    Displays the content of a MaxCompute table or resource file.

upload
    Uploads local files or directories to MaxCompute tables or resources.

download
    Downloads data from MaxCompute tables to local files.

whoami
    Shows the current user's Alibaba Cloud account information and MaxCompute project context.

set
    Configures various MaxCompute session parameters, such as project, endpoint, tunnel settings, or SQL execution options.

help
    Provides assistance on the odps command itself or specific subcommands.

DESCRIPTION

The odps command provides a powerful command-line interface (CLI) for interacting with Alibaba Cloud's MaxCompute service. MaxCompute, formerly known as Open Data Processing Service (ODPS), is a serverless, highly scalable platform designed for large-scale data warehousing, analytics, and machine learning. The odps CLI allows users to manage MaxCompute projects, execute SQL and MapReduce jobs, upload and download data, create and manage tables, views, UDFs (User-Defined Functions), and other resources directly from their terminal. It serves as a primary tool for developers, data engineers, and analysts to automate data tasks, perform ad-hoc queries, and script complex data workflows without needing to access the web console. This command facilitates efficient interaction with the MaxCompute ecosystem for big data processing and analysis.

CAVEATS

The odps command is not a native Linux utility but a client application for Alibaba Cloud's MaxCompute service. It typically requires Java Runtime Environment (JRE) to be installed. Proper configuration with Alibaba Cloud AccessKey ID, AccessKey Secret, and the MaxCompute project endpoint is essential for its operation. Network latency to the MaxCompute service can impact command execution performance. Authentication tokens have limited validity and may require re-authentication.

CONFIGURATION

The client typically uses a configuration file (e.g., odps_config.ini) to store connection details like AccessKey, project name, and endpoint. These can also be passed via environment variables or command-line arguments.

INTERACTIVE MODE

Many subcommands, particularly sql, support an interactive shell mode for executing multiple commands sequentially, similar to traditional database clients.

SECURITY

Access to MaxCompute resources via the odps command is governed by Alibaba Cloud RAM (Resource Access Management) policies associated with the AccessKey used.

HISTORY

The odps command-line client has evolved as an integral part of Alibaba Cloud's big data ecosystem. Originally designed for the Open Data Processing Service (ODPS), it continued its development and importance after the rebranding of ODPS to MaxCompute. It has consistently served as the primary programmatic and interactive interface for users to manage and interact with their MaxCompute data warehouses and compute jobs, paralleling the growth of Alibaba Cloud's global big data offerings. Its design reflects common patterns found in database command-line interfaces, adapting them for the distributed, serverless nature of MaxCompute.

SEE ALSO

mysql(1), psql(1), bq(1) (Google BigQuery CLI), aws(1) (AWS CLI)

Copied to clipboard