OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.4.2

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    ODPS catalog

    Last Updated:2026-04-02 06:23:56  Updated
    Share
    What is on this page
    Supported capabilities
    Limitations
    Prerequisites
    Syntax for creating an ODPS catalog
    Parameter description
    API_MODE
    Example
    Usage
    Switch catalog
    Query ODPS tables
    Metadata operations
    Delete a catalog
    References

    folded

    Share

    OceanBase Database V4.3.5 BP2 and later support the catalog feature. This feature adds a catalog layer to the traditional Database → Table two-level model, forming a three-level architecture of Catalog → Database → Table.

    With the ODPS catalog feature, you can directly query data from tables in Alibaba Cloud MaxCompute (formerly known as ODPS) without manually creating external table mappings. This feature is suitable for accelerating offline data warehouse queries.

    • Direct query without ETL: You can directly access tables in MaxCompute without the need to create external tables.
    • Unified metadata: The database and table structures in ODPS projects are automatically synchronized.
    • Cross-source JOIN: You can perform JOIN queries between OceanBase Database internal tables and MaxCompute tables.

    Supported capabilities

    • Read-only queries: Supports analytical operations such as SELECT, JOIN, and GROUP BY.
    • No write operations: Prohibits DML/DDL operations such as INSERT, UPDATE, and DROP TABLE.
    • Partition and column pruning: Automatically pushes down filter conditions to reduce data transfer.

    Limitations

    Limitation
    Description
    Complex data types Does not support nested complex types such as ARRAY<MAP<STRING, BIGINT>>
    Performance dependency Query speed is affected by MaxCompute Tunnel quotas and network bandwidth
    Environment dependency Requires deployment of Java SDK (as MaxCompute SDK is based on Java)

    For more information about environment dependencies, see Deploy OceanBase Java SDK environment.

    Prerequisites

    1. Permissions

      • The current user must have the CREATE CATALOG permission (MySQL-compatible mode) or the CREATE CATALOG system permission (Oracle-compatible mode).
      • The user must have the USE CATALOG permission (which can be granted to a specific catalog or globally) for queries.
    2. Access credentials

      • You have obtained the AccessKey ID and Secret of MaxCompute (or an STS token).
      • The OceanBase cluster can access the MaxCompute endpoint and tunnel endpoint.
    3. Authorization configuration

      • The MaxCompute project has authorized the RAM user used by OceanBase (at least Read permission). For more information, see Overview of MaxCompute storage access.

    Syntax for creating an ODPS catalog

    CREATE EXTERNAL CATALOG [IF NOT EXISTS] catalog_name
    PROPERTIES (
        TYPE = 'ODPS',
        [ACCESSTYPE = 'aliyun' | 'sts' | 'app'],
        ACCESSID = 'your-access-id',
        ACCESSKEY = 'your-access-key',
        [STSTOKEN = 'your-sts-token'],  -- Required only when ACCESSTYPE='sts'
        ENDPOINT = 'http://service.cn-hangzhou.maxcompute.aliyun.com/api',
        TUNNEL_ENDPOINT = 'http://dt.cn-hangzhou.maxcompute.aliyun.com',
        PROJECT_NAME = 'your_odps_project',
        [QUOTA_NAME = 'your_quota'],
        [COMPRESSION = 'zlib' | 'zstd' | 'lz4' | 'odps_lz4'],
        API_MODE = {"tunnel_api" | "storage_api"},
        SPLIT = {"byte" | "row"}
        REGION = 'region_name'
    );
    

    Parameter description

    Parameter
    Required
    Description
    TYPE Yes Fixed to 'ODPS'
    ACCESSTYPE No The account type. Default value: aliyun. Valid values: aliyun, sts, and app.
    ACCESSID / ACCESSKEY Yes The AccessKey of the RAM user (not the main account AK).
    STSTOKEN Conditional Required only when ACCESSTYPE = 'sts'.
    ENDPOINT Yes The endpoint of MaxCompute, including the region.
    TUNNEL_ENDPOINT Yes The tunnel endpoint, used for efficient data retrieval.
    PROJECT_NAME Yes The name of the MaxCompute project (equivalent to a database).
    QUOTA_NAME No The name of the compute resource quota (if applicable).
    COMPRESSION No The data compression format (must match the ODPS table). If not specified, compression is disabled.
    API_MODE Yes Specifies the API mode for accessing ODPS. For more information, see the details below.
    SPLIT Yes When using storage_api, specifies whether to split tasks by byte or row. If the data size of each row in a table varies significantly, set SPLIT to byte. Otherwise, set it to row.
    REGION Yes The region where MaxCompute is enabled.

    API_MODE

    Starting from OceanBase Database V4.3.5 BP3, the API_MODE and SPLIT parameters are supported in OceanBase Database V4.3.5:

    • tunnel_api (default):

      • No special network configuration is required: applicable to all deployment scenarios, without the need for OceanBase Database and MaxCompute to be in the same VPC (Virtual Private Cloud).

      • No additional MaxCompute permissions are required: only the AccessID and AccessKey are needed for authentication, without the need to enable MaxCompute Storage API permissions.

      • Applicable environments:

        • OceanBase Database and MaxCompute are not deployed in the same VPC.
        • MaxCompute Storage API is not enabled.
        • Data transmission is not latency-sensitive.
    • storage_api:

      • Network dependency: requires OceanBase Database and MaxCompute to be deployed in the same VPC to achieve low latency and high throughput data transmission.

      • Permission dependency: requires enabling the Storage API in MaxCompute and ensuring the AccessKey has the necessary permissions.

      • Quota requirements: when using the storage_api mode, the QUOTA parameter must be set to pay-as-you-go (on-demand) quota to ensure normal billing and execution of Storage API calls. For more information, see: Overview of MaxCompute Storage API.

      • Applicable environments:

        • OceanBase Database and MaxCompute are in the same VPC.
        • MaxCompute Storage API is enabled.
        • Large volumes of data or high real-time requirements.

    Example

    CREATE EXTERNAL CATALOG odps_prod
    PROPERTIES (
        TYPE = 'ODPS',
        ACCESSID = 'LTAI5tXXXXXX',
        ACCESSKEY = 'xxxxxxxxxxxxxx',
        ENDPOINT = 'http://service.cn-hangzhou.maxcompute.aliyun.com/api',
        TUNNEL_ENDPOINT = 'http://dt.cn-hangzhou.maxcompute.aliyun.com',
        PROJECT_NAME = 'sales_analytics',
        REGION = 'cn-hangzhou'
    );
    

    Security recommendations:

    • Use RAM subaccounts and follow the principle of least privilege.
    • Avoid hardcoding plaintext AKs in SQL; instead, inject them using variables or a key management service.

    Usage

    Switch catalog

    -- Method 1: Switch only the catalog
    SET CATALOG odps_prod;
    
    -- Method 2: Switch both the catalog and database
    USE odps_prod.sales_db;
    

    Query ODPS tables

    -- If the catalog has been switched to odps_prod, you can directly query
    SELECT * FROM user_log
    WHERE dt = '20250401'
    LIMIT 10;
    
    -- Federated query (JOIN with internal tables)
    SELECT o.order_id, u.city
    FROM internal.test_db.orders o
    JOIN users u ON o.user_id = u.id;
    

    Metadata operations

    -- View table structure
    DESC odps_prod.sales_db.user_log;
    
    -- View create table statement
    SHOW CREATE TABLE odps_prod.sales_db.user_log;
    
    -- List all catalogs in the current tenant
    SHOW CATALOGS;
    
    -- View create catalog statement
    SHOW CREATE CATALOG odps_prod;
    

    Delete a catalog

    DROP CATALOG IF EXISTS odps_prod;
    

    References

    • Deploy the OceanBase JAVA SDK environment
    • CREATE EXTERNAL CATALOG

    Previous topic

    Internal catalog
    Last

    Next topic

    HMS Catalog
    Next
    What is on this page
    Supported capabilities
    Limitations
    Prerequisites
    Syntax for creating an ODPS catalog
    Parameter description
    API_MODE
    Example
    Usage
    Switch catalog
    Query ODPS tables
    Metadata operations
    Delete a catalog
    References