Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex MPP Analytics for PostgreSQL
  • Getting started
    • All guides
      • Overview
        • S3
        • JDBC
        • HDFS
        • Hive
      • Creating an external table
      • Editing PXF settings
    • Connecting to an external file server (gpfdist)
    • Auxiliary utilities
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  1. Step-by-step guides
  2. Working with PXF
  3. Creating external data sources
  4. JDBC

Creating an external JDBC data source

Written by
Yandex Cloud
Updated at May 7, 2026

In Yandex MPP Analytics for PostgreSQL, you can use the following as an external data source with the JDBC connection type:

  • ClickHouse®
  • MySQL®
  • Oracle
  • PostgreSQL
  • SQL Server
  • Trino

This list contains managed Yandex Cloud DBs and third-party DBs.

Create an external data sourceCreate an external data source

Management console
CLI
REST API
gRPC API
SQL
  1. Open the folder dashboard.
  2. Navigate to Yandex MPP Analytics for PostgreSQL.
  3. Open the page of the Greenplum® cluster in question.
  4. In the left-hand panel, select  PXF.
  5. Click Create data source.
  6. Select the JDBC connection type.
  7. Enter a source name.
  8. Configure at least one optional setting.
  9. Click Create.

After you create an external data source, create an external table.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

To create an external JDBC data source:

  1. View the description of the CLI command for creating a data source:

    yc managed-greenplum pxf-datasource create jdbc --help
    
  2. Configure the data source:

    yc managed-greenplum pxf-datasource create jdbc <external_data_source_name> \
       --cluster-id=<cluster_ID> \
       --driver=<driver_address> \
       --url=<database_URL> \
       --user=<username> \
       --password=<password>
    

    Where:

    • cluster-id: Cluster ID. You can get it with the list of clusters in the folder.

    • driver: JDBC driver class in Java. The possible values are:

      • com.clickhouse.jdbc.ClickHouseDriver
      • com.ibm.as400.access.AS400JDBCDriver
      • com.microsoft.sqlserver.jdbc.SQLServerDriver
      • com.mysql.cj.jdbc.Driver
      • org.postgresql.Driver
      • oracle.jdbc.driver.OracleDriver
      • net.snowflake.client.jdbc.SnowflakeDriver
      • io.trino.jdbc.TrinoDriver
    • url: Database URL. Examples:

      • jdbc:mysql://mysqlhost:3306/testdb: For a local MySQL® database.
      • jdbc:postgresql://c-<cluster_ID>.rw.mdb.yandexcloud.net:6432/db1: For a Yandex Managed Service for PostgreSQL cluster. The address contains a special FQDN of the master host in the cluster.
      • jdbc:oracle:thin:@host.example:1521:orcl: For an Oracle database.
    • user: DB owner username.

    • password: DB user password.

    You can also configure advanced settings.

After you create an external data source, create an external table.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Call the PXFDatasource.Create method, e.g., via the following cURL request:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-greenplum/v1/clusters/<cluster_ID>/pxf_datasources' \
        --data '{
                  "datasource": {
                    "name": "<external_data_source_name>",
                    "jdbc": {
                      "driver": "<driver_address>",
                      "url": "<database_URL>",
                      "user": "<user_login>",
                      "password": "<user_password>",
                      ...
                    }
                  }
                }'
    

    Where:

    • name: External data source name.
    • jdbc: External data source settings. Configure at least one optional setting.

    You can get the cluster ID with the list of clusters in the folder.

  3. Check the server response to make sure your request was successful.

After you create an external data source, create an external table.

  1. Get an IAM token for API authentication and put it into an environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume that the repository contents reside in the ~/cloudapi/ directory.

  3. Call the PXFDatasourceService.Create method, e.g., via the following gRPCurl request:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/greenplum/v1/pxf_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>"
              "datasource": {
                "name": "<external_data_source_name>",
                "jdbc": {
                  "driver": "<driver_address>",
                  "url": "<database_URL>",
                  "user": "<user_login>",
                  "password": "<user_password>",
                  ...
                }
              }
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.greenplum.v1.PXFDatasourceService.Create
    

    Where:

    • name: External data source name.
    • jdbc: External data source settings. Configure at least one optional setting.

    You can get the cluster ID with the list of clusters in the folder.

  4. Check the server response to make sure your request was successful.

After you create an external data source, create an external table.

This method works well for Yandex MPP Analytics for PostgreSQL that uses Apache Cloudberry™.

To create an external data source and an external table using SQL, follow these steps:

  1. Create an external data source:

    CREATE SERVER pgserver
      FOREIGN DATA WRAPPER jdbc_pxf_fdw
      OPTIONS (
        CONFIG 'default',
        JDBC_DRIVER 'org.postgresql.Driver',
        DB_URL 'jdbc:postgresql://host:5432/db',
        USER '<username>',
        PASS '<password>'
      );
    
  2. Create a mapping between a local user and a user in the external data source:

    CREATE USER MAPPING FOR CURRENT_USER
      SERVER "pgserver";
    
  3. Create an external table:

    CREATE FOREIGN TABLE <table_name>
      (<column_name> <data_type> [, ...])
      SERVER "pgserver";
    

Greenplum® and Greenplum Database® are registered trademarks or trademarks of Broadcom Inc. in the United States and/or other countries.

ClickHouse® is a registered trademark of ClickHouse, Inc.

Was the article helpful?

Previous
S3
Next
HDFS
© 2026 Direct Cursus Technology L.L.C.