Updated on 2025-03-24 GMT+08:00

DWS Datasets

Data Warehouse Service (DWS) is a fully-managed, enterprise-level cloud data warehouse service. It is O&M-free and supports online scale-out and multi-source data loading, and it is compatible with the PostgreSQL ecosystem. It helps enterprises efficiently analyze and monetize massive amounts of data online. For more information about DWS, see the DWS documentation.

Prerequisites

The data source to be connected has been created. For details, see DWS Data Sources.

Constraints

When configuring a DWS dataset, if the SQL statement contains a keyword matching a field name in the DWS database, enclose the keyword in double quotation marks ("). For more DWS keywords, see Keyword.

Creating a DWS Dataset

  1. Log in to Huawei Cloud Astro Canvas by referring to Logging In to Huawei Cloud Astro Canvas.
  2. Choose Data Center from the main menu.
  3. Choose Datasets > All in the navigation pane.
  4. On the Dataset Management page, click Create.
  5. Set the dataset name, specify the data type, data source, and folder, and click Save.

    Figure 1 Creating a DWS dataset
    • Dataset Name: A dataset is identified by its name. The name contains 1 to 60 characters, including letters, digits, and underscores (_).
    • Data Type: Select DWS.
    • Data Source: Select the data source created in DWS Data Sources.
    • Folder: Set the folder for storing the dataset. You can select the folder created in (Optional) Creating a Folder or click New Folder.
    • Owner: Creator of the dataset.
    • Description: Description of the new dataset, which is usually the function of the dataset.

  6. Configure dataset parameters.

    Figure 2 Configuring a dataset
    • You can select a data table from a specified schema. If no schema is specified, data is obtained from public database tables by default.
      select * from pg_catalog."pg_index"

      pg_catalog indicates the specified schema, and pg_index indicates the table in the database.

      When customizing SQL statements, you can enter $ to access the expression setting page. On the displayed page, you can select a field or function from the left pane, or enter a function, as shown in Figure 3.

      Figure 3 Setting expressions
    • Click refresh data button to preview the queried data.

  7. Click Save. The DWS dataset is created.

Using the Dataset in Widgets

  1. Return to the Projects page.
  2. Go to the canvas page and drag required widgets (for example, bar chart) to the canvas.

    Figure 4 Dragging a basic bar chart widget to the canvas

  3. Select the widget and click .
  4. Select Dataset from the Data Type drop-down list and select the dataset created in section Creating a DWS Dataset.
  5. Set global variables.

    Global variables can be regarded as parameter variables and used to control parameter transfer between widgets for interactions such as diagram and table association and field customization.

  6. In Widget Preview, select the form fields to be displayed by dragging them from the left column to the right column, and click Save.

    Figure 5 Dragging a field to the axis
    • Form field: Data recorded in section Creating a DWS Dataset.
    • Configuration: Drag the required fields from the form field area to the X-axis data, Y-axis data, and series.
    • Refresh cycle: Interval for obtaining data from DWS. Default is 0, meaning the data is obtained only once.
    • Data sharing: When enabled, multiple widgets calling the same bridge URL request will share the result data.

  7. Select the basic bar chart widget, click , and set the title to "Score Statistics of Each Class".

    Figure 6 Setting the chart title

  8. Click in the upper part of the page to save the settings.
  9. Click to preview.