MCPcopy Index your code
hub / github.com/aliyun/aliyun-odps-console

github.com/aliyun/aliyun-odps-console @v0.58.0-public

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.58.0-public ↗ · + Follow
2,771 symbols 11,175 edges 346 files 390 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ODPS Console

Build Status

The ODPS Console is a command-line interface for interacting with Alibaba Cloud's MaxCompute ( formerly ODPS) big data processing platform. It provides a powerful and flexible way to manage and interact with MaxCompute projects, tables, resources, and jobs directly from the terminal.

MaxCompute is a fully managed, serverless data warehousing and analytics platform that allows you to process exabytes of data with high concurrency and throughput. The ODPS Console enables developers, data engineers, and analysts to perform common tasks such as running SQL queries, uploading/downloading data, managing resources, and submitting MapReduce jobs.

Features

The ODPS Console offers a comprehensive set of features organized in a modular plugin architecture:

  • SQL Execution - Run interactive SQL queries and scripts against MaxCompute tables with support for:

    • Standard SQL syntax with extensions
    • Interactive query mode for faster execution
    • Query cost estimation and confirmation for large data operations
    • Result set visualization and export
    • Support for materialized views, virtual views, and external tables
  • Data Tunnel - High-performance data upload and download between local files and MaxCompute tables with:

    • Support for various file formats (CSV, JSON, etc.)
    • Parallel data transfer for improved performance
    • Data size confirmation to prevent accidental large transfers
    • Custom tunnel endpoints for optimized data transfer
  • MapReduce Jobs - Submit and manage MapReduce jobs on the MaxCompute platform:

    • Execute distributed computing tasks
    • Monitor job progress and status
    • Manage job configurations and parameters
  • Resource Management - Create, update, and delete resources used by MaxCompute functions:

    • Support for JAR, Python, and other resource types
    • Function creation and management with class path specification
    • Resource dependency management for complex functions
  • Workflow Management - Execute and monitor XFlow workflows:

    • Manage offline and online machine learning models
    • Execute complex data processing pipelines
    • Monitor workflow instances and status
  • Authentication - Secure authentication with multiple credential options:

    • AccessKey/SecretKey authentication
    • STS token authentication for temporary credentials
    • Application-based authentication
    • Support for various account providers (aliyun, sts, etc.)
  • Volume File System - Manage files in the MaxCompute volume file system:

    • Create and manage external volumes
    • File operations within the MaxCompute environment
    • Integration with Hadoop-compatible file system operations
  • Cupid Integration - Support for managed service features:

    • Spark job submission and management
    • Job monitoring and visualization
    • Integration with Alibaba Cloud managed services
  • Advanced Table Operations - Comprehensive table management capabilities:

    • Show tables with filtering and pattern matching
    • Detailed table schema inspection with extended metadata
    • Partition management for partitioned tables
    • Table lifecycle and storage management
  • Instance Management - Complete control over job instances:

    • Submit, monitor, and manage SQL and other job instances
    • Instance priority settings for resource allocation
    • Wait and status checking commands
    • Instance termination capabilities
  • Project Management - Multi-project support with:

    • Project switching and context management
    • Project-level metadata inspection
    • Cross-project resource access
  • Interactive Mode - Enhanced command-line experience:

    • Persistent session with command history
    • Tab completion for commands and table names
    • Syntax highlighting and formatting
    • Multi-line command editing

Getting Started

Prerequisites

  • Java 8 or higher
  • An Alibaba Cloud account with MaxCompute service enabled
  • Network access to MaxCompute service endpoints

Installation

Option 1: Download Pre-built Package (Recommended)

  1. Download the latest release: bash wget https://github.com/aliyun/aliyun-odps-console/releases/latest/download/odpscmd_public.zip

If the link above doesn't work, try: bash wget https://maxcompute-repo.oss-cn-hangzhou.aliyuncs.com/odpscmd/latest/odpscmd_public.zip

  1. Extract the package: bash unzip odpscmd_public.zip cd odpscmd_public

  2. Verify the installation by checking the directory structure: bin/ # Executable scripts conf/ # Configuration files lib/ # Library dependencies plugins/ # Plugin modules

Option 2: Build from Source

  1. Ensure you have the prerequisites installed:

    • Java 8 or higher
    • Apache Maven 3.0 or higher
  2. Clone the repository and build: bash git clone https://github.com/aliyun/aliyun-odps-console.git cd aliyun-odps-console mvn clean package -DskipTests

  3. The built package will be available at: odps-console-dist-public/target/odpscmd_public.zip

Configuration

Before using the ODPS Console, you need to configure it with your MaxCompute credentials and settings.

  1. Create a configuration file at conf/odps_config.ini: ```ini # Basic configuration (required) project_name = your_project_name access_id = your_access_id access_key = your_access_key end_point = your_endpoint

# Optional configurations for enhanced functionality log_view_host = https://logview.odps.aliyun.com debug = false instance_priority = 9 ```

  1. You can obtain your endpoint from the MaxCompute endpoints documentation.

  2. For detailed configuration options, see the Configuration section below.

Quick Start

  1. Run the console in interactive mode: bash ./bin/odpscmd

  2. You should see a prompt like: ``` ODPS Console Aliyun ODPS Command Line Tool Version 0.52.3-public

odps@your_project_name> ```

  1. Execute a simple command to verify your setup: sql odps@your_project_name> show tables;

  2. For batch execution, you can run commands directly: ```bash # Execute a single SQL command ./bin/odpscmd -e "show tables;"

# Execute a SQL script file ./bin/odpscmd -f /path/to/script.sql ```

Common First Steps

  1. List tables in your project: sql show tables;

  2. Describe a table structure: sql desc table_name;

  3. Run a simple query: sql select * from table_name limit 10;

  4. Upload data to a table: sql tunnel upload /path/to/local/file.txt table_name;

  5. Download data from a table: sql tunnel download table_name /path/to/local/file.txt;

Command Line Options

The ODPS Console supports several command-line options:

  • -e "command" - Execute a single command and exit
  • -f script.sql - Execute commands from a script file
  • --config file - Specify a custom configuration file
  • -h, --help - Display help information
  • -v, --version - Display version information

Example:

./bin/odpscmd -e "select count(*) from my_table;" --config /path/to/custom_config.ini

Configuration

The ODPS Console requires configuration to connect to your MaxCompute project. The configuration is specified in an odps_config.ini file with the following parameters:

Basic Configuration Parameters

Parameter Description Required Default Value
project_name The name of your MaxCompute project Yes None
access_id Your Alibaba Cloud Access Key ID Yes None
access_key Your Alibaba Cloud Access Key Secret Yes None
end_point The API endpoint for MaxCompute service Yes None
schema_name The schema name in MaxCompute No None

Network and Proxy Configuration

Parameter Description Required Default Value
proxy_host Proxy server hostname No None
proxy_port Proxy server port No None
https_check Enable SSL certificate verification No true
network_read_timeout Network read timeout in milliseconds No None
network_connect_timeout Network connection timeout in milliseconds No None

Logging and Debugging Configuration

Parameter Description Required Default Value
log_view_host The host for LogView (job execution logs) No https://logview.odps.aliyun.com
log_view_version LogView version No None
log_view_life LogView life time in hours No 720 (30 days)
debug Enable debug mode for detailed logging No false

Authentication Configuration

Parameter Description Required Default Value
account_provider Authentication method (aliyun, sts, etc.) No aliyun
sts_token Security Token Service token for temporary credentials No None

Job and Execution Configuration

Parameter Description Required Default Value
instance_priority Priority for job execution (0-9, where 0 is highest) No 9
use_instance_tunnel Use instance tunnel for SQL result download No false
instance_tunnel_max_record Maximum records to download via instance tunnel No None
instance_tunnel_max_size Maximum size to download via instance tunnel (bytes) No None
running_cluster Specify the cluster to run jobs No None

Interactive Mode Configuration

Parameter Description Required Default Value
enable_interactive_mode Enable interactive query mode No false
interactive_service_name Name of the interactive service No public.default
interactive_output_compatible Enable compatible output mode for interactive queries No false
interactive_auto_rerun Automatically rerun failed interactive queries No false
interactive_max_attach Maximum number of sessions to attach No None
attach_session_timeout Timeout for attaching sessions (seconds) No 60
keep_session_variables Keep session variables when switching projects No false

Tunnel and Data Transfer Configuration

Parameter Description Required Default Value
tunnel_endpoint Custom endpoint for tunnel service No None
hub_endpoint Custom endpoint for DataHub service No None
data_size_confirm Confirmation threshold for data size (GB) No None

Performance and Optimization Configuration

Parameter Description Required Default Value
lite_mode Enable lite mode for faster execution No false
enable_quota_cache Enable quota information caching No false
skip_progress Skip progress reporting for better performance No false

System and Update Configuration

Parameter Description Required Default Value
update_url Custom URL for update checks No None
post_hook_class Custom post-hook class for extensions No None
user_commands Custom user commands configuration No None

Session and Fallback Configuration

| Parameter | Description | Required | Default Value | |---

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 2,280
Class 391
Function 84
Enum 10
Interface 6

Languages

Java97%
TypeScript3%

Modules by API surface

odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/ExecutionContext.java158 symbols
odps-console-basic/src/test/resources/html/jquery-2.1.4.js81 symbols
odps-console-xflow/src/main/java/com/aliyun/openservices/odps/console/xflow/GetJobResponseBody.java68 symbols
odps-console-dship/src/test/java/com/aliyun/odps/ship/optionparser/ParseUploadCommandTest.java32 symbols
odps-console-dship/src/test/java/com/aliyun/odps/ship/common/RecordConverterTest.java32 symbols
odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/utils/ODPSConsoleUtils.java32 symbols
odps-console-dship/src/test/java/com/aliyun/odps/ship/optionparser/ParseDownloadCommandTest.java31 symbols
odps-console-dship/src/main/java/com/aliyun/odps/ship/common/OptionsBuilder.java29 symbols
odps-console-xflow/src/main/java/com/aliyun/openservices/odps/console/xflow/PAICommand.java26 symbols
odps-console-sql/src/main/java/com/aliyun/openservices/odps/console/InteractiveQueryCommand.java26 symbols
odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/output/state/InstanceStateContext.java26 symbols
odps-console-basic/src/main/java/com/aliyun/openservices/odps/console/commands/ExternalProjectCommand.java26 symbols

For agents

$ claude mcp add aliyun-odps-console \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page