All Products
Search
Document Center

Create a Table Store schema

Last Updated: Apr 24, 2019

Procedure

Log on to the Data Lake Analytics console. In the endpoint list, locate the row that contains the target endpoint and click Log on in DMS in the Actions column to create a Table Store schema:

  1. CREATE SCHEMA hangzhou_ots_test WITH DBPROPERTIES (
  2. catalog = 'ots',
  3. location = 'https://otsInstanceName.cn-hangzhou.ots-internal.aliyuncs.com',
  4. instance = 'ots-instance-name'
  5. );

A private network communication is provided between DLA and Table Store for you through VPC policies. You must use the private IP address of your Table Store instance when creating the connection.

  • catalog = 'ots': creates a connection between DLA and your Table Store instance.

  • hangzhou_ots_test: indicates the name of the connection between DLA and your Table Store instance.

  • location: indicates the DLA endpoint or VPC endpoint in your Table Store instance, which are the same.

  • instance: indicates the name of your Table Store instance.

View database and table information in DLA

After you created the connection, you can view the database and table information in DLA. Alternatively, you can connect to DLA through a MySQL client or MySQL CLI tool, and then view the database and table information in DLA. The following example describes how to use an MySQL CLI tool to view the schema and table information.

  • View database information

    1. mysql> show databases;
    2. +------------------------------+
    3. | Database |
    4. +------------------------------+
    5. | hangzhou_ots_test |
    6. +------------------------------+
    7. 1 rows in set (0.22 sec)
    8. mysql> show create database hangzhou_ots_test;
    9. +-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    10. | Database | Create Database |
    11. +-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    12. | hangzhou_ots_test | CREATE DATABASE `hangzhou_ots_test`
    13. WITH DBPROPERTIES (
    14. CATALOG = 'ots',
    15. LOCATION = 'location = 'https://otsInstanceName.cn-hangzhou.ots-internal.aliyuncs.com',
    16. INSTANCE = 'ots-instance-name'
    17. ) |
    18. +-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    19. 1 row in set (0.31 sec)
  • View table information

    1. mysql> use hangzhou_ots_test;
    2. Database changed
    3. mysql> show tables;
    4. Empty set (0.30 sec)

Next step

Create a Table Store table and read data from the table