• Data Warehouse Service

dws
  1. Help Center
  2. Data Warehouse Service
  3. User Guide
  4. Getting Started
  5. Step 5: Importing Sample Data to a Data Warehouse Cluster

Step 5: Importing Sample Data to a Data Warehouse Cluster

Scenario

DWS users can import data from external sources to a data warehouse cluster. This section describes how to import sample data from OBS to a data warehouse cluster. The sample data is generated based on the TPC-DS benchmark test.

Prerequisites

Procedure

  1. In the ECS Linux command window, run the following commands to switch to a specific directory and set the AK and SK for importing sample data and the OBS access address:

    cd ./sample

    /bin/bash setup.sh -ak <Access_Key_Id> -sk <Secret_Access_Key> -obs_location obs.otc.t-systems.com

    If the following information is displayed, the setting is successful:

    setup successfully!
    NOTE:

    Obtain values of Access_Key_Id and Secret_Access_Key from section Creating Access Keys (AK and SK).

  2. In the ECS Linux command window, run the following command to import the sample data to the data warehouse cluster:

    gsql -d <Database name> -h <Public network address of the cluster> -U <Administrator> -p <Data warehouse port number> -f <Path for storing the sample data script> -r

    gsql -d postgres -h 10.168.0.74 -U dbadmin -p 8000 -f tpcds_load_data_from_obs.sql -r

    NOTE:

    In the preceding command, sample data script tpcds_load_data_from_obs.sql is stored in the sample directory (for example, dws_client_redhat_x64\sample) of the DWS client.

    After you enter the administrator password and successfully connect to the database in the cluster, the system will automatically create a foreign table with the sample data to associate data outside the cluster, create a table, and then import data to the table.

    When information similar to the following is displayed, the data is successfully imported.

    Time:1845600.524 ms