Filesystem catalog Paimon external projects

Updated at:

You can use MaxCompute to create an external project by mapping a Paimon catalog directory in OSS. This creates a project that mirrors the standard Paimon file system hierarchy. Access permissions are based on the authorization granted to a user's RAM role for the OSS bucket, supporting read and write operations on both metadata and data in the Paimon lake format. With this catalog-level mapping, you are responsible for ensuring file system compliance and managing your own permissions and storage for files in the lake format. This approach is ideal for stream-batch integration scenarios where permissions are controllable and you can handle maintenance independently.

Important

Deleting an external project is a physical deletion operation that clears some historical information but does not delete data in the source system. The operation can take a long time. Wait for it to complete.

Limitations

  • Only tables in Paimon format are supported.

  • Writing to Dynamic Bucket tables is not supported.

  • Writing to Cross Partition tables is not supported.

  • For more information, see Data type mapping.

Procedure

Step 1: Grant permissions to a RAM user

If you are a RAM user, ensure the following policy is attached to your account. For instructions, see Manage RAM user permissions.

  • AliyunMaxComputeFullAccess: Grants the permissions required to create external data sources and external projects.

Step 2: Create a FileSystem Catalog external data source

  1. Activate OSS and create a bucket to store your Paimon data. For more information, see Quick start.

  2. Log in to the MaxCompute console and select a region in the upper-left corner.

  3. In the left-side navigation pane, choose Manage Configurations > External Data Source .

  4. On the External Data Source page, click Create External Data Source.

  5. In the Create External Data Source dialog box, configure the parameters. The following tables describe the parameters.

    Parameter

    Required

    Description

    External Data Source Type

    Yes

    Select FileSystem Catalog.

    External Data Source Name

    Yes

    The name of the external data source. The name must meet the following requirements:

    • It must start with a letter and can contain only lowercase letters, digits, and underscores (_).

    • It must be 128 characters or fewer.

    Example: external_fs.

    Description

    No

    Optional. A description of the external data source.

    Region

    Yes

    Defaults to the current region.

    Authentication and Authorization

    Yes

    Defaults to Alibaba Cloud RAM role.

    Role ARN

    Yes

    The Alibaba Cloud Resource Name (ARN) of the RAM role. This role must have permissions to access OSS.

    1. Log in to the RAM console.

    2. In the left navigation bar, select Identities > Roles.

    3. In the Basic Information section, you can obtain the ARN.

    Example: acs:ram::124****:role/aliyunodpsdefaultrole.

    Storage Type

    Yes

    • OSS

    • OSS-HDFS

    Endpoint

    Yes

    The endpoint is automatically generated. For the China (Hangzhou) region, the endpoint is oss-cn-hangzhou-internal.aliyuncs.com.

    Foreign Server Supplemental Properties

    No

    Additional properties that define how tasks that use this data source access the source system.

    Note

    For information about the supported parameters, see the latest updates in the official documentation. More parameters will be gradually made available as the product evolves.

  6. Click OK to create the external data source.

  7. On the External Data Source page, find the data source and click Details in the Actions column to view its details.

Step 3: Create an external project

  1. Log in to the MaxCompute console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose Manage Configurations > Projects.

  3. On the External Project tab, click Create Project.

  4. In the Create Project dialog box, configure the settings and click OK.

    Parameter

    Required

    Description

    Project Type

    Yes

    Defaults to external project.

    Region

    Yes

    Defaults to the current region. This parameter cannot be modified.

    Project Name (Globally Unique)

    Yes

    Must be 3 to 28 characters long, start with a letter, and contain only letters, digits, and underscores (_).

    MaxCompute Foreign Server Type

    No

    Select FileSystem Catalog.

    MaxCompute Foreign Server

    No

    • Use Existing: Select an existing external data source.

    • Create Foreign Server: Create and use a new external data source.

    MaxCompute Foreign Server Name

    Yes

    • Use Existing: Select the name of an existing external data source from the drop-down list.

    • Create External Data Source: The name of the new external data source is used.

    Bucket Catalog

    Yes

    Select the full path from the OSS bucket to the catalog-level file system directory. Example: oss://paimon-fs/paimon-test/.

    Table Format

    Yes

    Defaults to Paimon.

    Billing Method

    Yes

    Subscription or Pay-as-you-go.

    Default Quota

    Yes

    Select an existing quota.

    Description

    No

    A custom description for the project.

Step 4: Use SQL to access data

Important

Deleting an external project does not delete the underlying data because the project is only a mapping to the data source.

However, unlike with standard external tables, running a DROP TABLE or DROP SCHEMA command in an external project sends the request to the peer service. This permanently deletes the corresponding table or database. Use DROP operations with caution.

  1. Select a connection tool to log on to the external project.

  2. List the schemas in the external project. By default, only the database paths that store Paimon tables are listed.

    -- Enable schema syntax at the session level.
    SET odps.namespace.schema=true;
    SHOW schemas;
    
    -- The following result is returned.
    ID = 20250922********wbh2u7
    default
    
    
    OK
  3. List the tables in a schema within the external project.

    -- schema_name is the name of the schema displayed in the external project.
    USE SCHEMA <schema_name>; 
    SHOW tables;
  4. Create a new schema in the external project.

    CREATE schema <schema_name>;
    
    -- Example:
    CREATE schema schema_test;
  5. Use the new schema.

    use schema <schema_name>;
    
    -- Example:
    use schema schema_test;
  6. Create a table in the schema and insert data.

    • Syntax:

      -- Create a table.
      CREATE TABLE [IF NOT EXISTS] <table_name> 
      (
        <col_name> <data_type>,
        ...
      )
      [COMMENT <table_comment>]
      [PARTITIONED BY (<col_name> <data_type>, ...)] 
      ;
      
      -- Insert data.
      INSERT {INTO|OVERWRITE} TABLE <table_name> [PARTITION (<pt_spec>)] [(<col_name> [,<col_name> ...)]]
      <select_statement>
      FROM <from_statement>
    • Example:

      CREATE TABLE new_table(id INT,name STRING);
      
      INSERT INTO new_table VALUES (101,'Alice'),(102,'Bob');
      
      -- Query the new_table table.
      SELECT * FROM new_table;
      
      -- The following result is returned.
      +------------+------------+
      | id         | name       | 
      +------------+------------+
      | 101        | Alice      | 
      | 102        | Bob        | 
      +------------+------------+

Passing Paimon table properties

Apache Paimon provides core configuration options. When creating a Paimon table in an external project, specify these options in the TBLPROPERTIES clause of your CREATE TABLE statement.

Configuration: Add parameters prefixed with mcfed. to the TBLPROPERTIES list. The parameter names after the prefix must match the native Paimon parameter names.

Example

Create a Paimon external table with buckets, a primary key, and partitions

  1. Create the table and configure its external parameters

    -- Switch to your external project. You can skip this step if you are already in it.
    use <your external project>;
    -- Enable schema syntax at the session level.
    SET odps.namespace.schema=true;
    -- Select the schema to use.
    use schema <your schema>;
    CREATE TABLE oss_extable_bucket_pk_pt_bucket
    (
        id BIGINT,
        name STRING,
        dt STRING
    )tblproperties (
        'mcfed.bucket'='3', -- Number of buckets
        'mcfed.bucket-key'='id', -- Bucket key. Optional if a primary key is specified.
        "mcfed.primary-key"="dt,id", -- Primary key
        "mcfed.partition"="dt" -- Partition field
        );
  2. Insert data into the external table

    use <your external project>;
    SET odps.namespace.schema=true;
    use schema <your schema>;
    
    INSERT INTO oss_extable_bucket_pk_pt_bucket PARTITION (dt='2025-06-18') 
      VALUES (1, 'Alice'),(2, 'Bob');
    INSERT INTO oss_extable_bucket_pk_pt_bucket PARTITION (dt='2025-06-19') 
      VALUES (3, 'Charlie'),(4, 'David'),(5, 'Eva');
  3. Query the external table

    use <your external project>;
    SET odps.namespace.schema=true;
    use schema <your schema>;
    
    SELECT * FROM oss_extable_bucket_pk_pt_bucket;
    
    -- Result:
    +------------+---------+------------+
    | id         | name    | dt         |
    +------------+---------+------------+
    | 1          | Alice   | 2025-06-18 |
    | 2          | Bob     | 2025-06-18 |
    | 4          | David   | 2025-06-19 |
    | 3          | Charlie | 2025-06-19 |
    | 5          | Eva     | 2025-06-19 |
    +------------+---------+------------+
    
  4. Log on to the Data Lake Formation (DLF) console, and in the upper-left corner, select a region.

    View the table details in the catalog.

Data type mapping

For more information about MaxCompute data types, see Data types (Version 1.0) and Data types (Version 2.0).

Paimon data type

MaxCompute 2.0 data type

Read/write support

Description

TINYINT

TINYINT

Supported

8-bit signed integer.

SMALLINT

SMALLINT

Supported

16-bit signed integer.

INT

INT

Supported

32-bit signed integer.

BIGINT

BIGINT

Supported

64-bit signed integer.

BINARY(MAX_LENGTH)

BINARY

Supported

Binary data type. The current maximum length is 8 MB.

FLOAT

FLOAT

Supported

32-bit binary floating-point number.

DOUBLE

DOUBLE

Supported

64-bit binary floating-point number.

DECIMAL(precision,scale)

DECIMAL(precision,scale)

Supported

Exact decimal numeric type. The default is decimal(38,18). You can customize the precision and scale values.

  • precision: The maximum number of digits. The valid values are 1 to 38.

  • scale: The number of digits in the fractional part. The valid values are 0 to 18.

VARCHAR(n)

VARCHAR(n)

Supported

Variable-length character type. n specifies the length and ranges from 1 to 65,535.

CHAR(n)

CHAR(n)

Supported

Fixed-length character type. n specifies the length and ranges from 1 to 255.

VARCHAR(MAX_LENGTH)

STRING

Supported

String type. The current maximum length is 8 MB.

DATE

DATE

Supported

Date type. The format is yyyy-mm-dd.

TIME, TIME(p)

Not supported

Not supported

The Paimon TIME data type represents a time without a time zone, consisting of hours, minutes, and seconds, with nanosecond precision.

TIME(p) specifies the fractional-second precision from 0 to 9. The default value is 0.

No corresponding type exists in MaxCompute.

TIMESTAMP, TIMESTAMP(p)

TIMESTAMP_NTZ

Supported

A timestamp type without a time zone that is accurate to the nanosecond.

To read this data type, you must disable the native JNI bridge by running the following command: SET odps.sql.common.table.jni.disable.native=true;

TIMESTAMP WITH LOCAL TIME_ZONE(9)

TIMESTAMP

Supported

  • A timestamp type that is accurate to the nanosecond. The format is yyyy-mm-dd hh:mm:ss.xxxxxxxxx.

  • For low-precision TIMESTAMP types in the Paimon source table, MaxCompute truncates values during writes. For precision 0-3, data is truncated to 3 digits. For precision 4-6, data is truncated to 6 digits. For precision 7-9, data is truncated to 9 digits.

TIMESTAMP WITH LOCAL TIME_ZONE(9)

DATETIME

Not supported

A timestamp type that is accurate to the nanosecond.

The format is yyyy-mm-dd hh:mm:ss.xxxxxxxxx.

BOOLEAN

BOOLEAN

Supported

A BOOLEAN type.

ARRAY

ARRAY

Supported

A complex type.

MAP

MAP

Supported

A complex type.

ROW

STRUCT

Supported

A complex type.

MULTISET<t>

Not supported

Not supported

No corresponding type exists in MaxCompute.

VARBINARY, VARBINARY(n), BYTES

BINARY

Supported

A data type of variable-length binary strings.