This topic describes how to create a PolarDB schema.

  1. Log on to the Data Lake Analytics console.

  2. In the left-side navigation pane, click SQL access point, find the required VPC, and then click Log on in DMS in the Actions column. The following statement demonstrates how to create a PolarDB schema in the Data Lake Analytics (DLA) console:

    ​create external table person (
           id int,
           name varchar(1023),
           age int
    ) tblproperties(
      table_mapping = 'hello_postgresql_vpc_rds.person'
    );​

    Parameter description

    • CATALOG='mysql1': indicates that a MySQL database is created in the Data Lake Analytics (DLA) console. The MySQL database in the DLA console directly connects to the PolarDB database by using the MySQL protocol because PolarDB is fully compatible with MySQL.

    • LOCATION: indicates that the URL is in the format of jdbc:mysql://Private IP address of the primary PolarDB node:Port number or PolarDB database name.

    • USER: indicates the username that is used to connect to the PolarDB database.

    • PASSWORD: indicates the password of the username that is used to connect to the PolarDB database.

    • VPC_ID: indicates the ID of the VPC where the PolarDB instance resides.

    • INSTANCE_ID: indicates the ID of the PolarDB instance.