A database is a framework, and tables are its essential content. A database contains one or more tables.
You can create databases and tables on the management console or using SQL statements.
This section describes how to create a data catalog, database, and table on the management console.
next to Databases.
Parameter | Description |
|---|---|
Database Name |
NOTE: The default database is a built-in database. You cannot create the default. database. |
Description | Description of a database. |
Tags | Tags used to identify cloud resources. A tag includes the tag key and tag value. If you want to use the same tag to identify multiple cloud resources, that is, to select the same tag from the drop-down list box for all services, you are advised to create predefined tags on the Tag Management Service (TMS). NOTE:
|
After a database is created, you can view and select the database for use on the Databases and Tables page or SQL Editor page.
Before creating a table, ensure that a database has been created.
Datasource connection tables, such as View tables, HBase (MRS) tables, OpenTSDB (MRS) tables, DWS tables, RDS tables, and CSS tables, cannot be created. You can use SQL to create views and datasource connection tables. For details, see "Creating a View" and "Creating a Datasource Connection Table" in Data Lake Insight SQL Syntax Reference.
on the right to create a table in the current database.
on the right of the database and choose Create Table from the shortcut menu to create a table in the current database.When there are both a folder and a file with the same name in the OBS directory, creating an OBS table pointing to that path will prioritize the file over the folder.
Parameter | Description | Example |
|---|---|---|
Table Name |
| table01 |
Data Location | Data storage location. Currently, DLI and OBS are supported. | DLI |
Description | Description of the table. | - |
Column Type | Available values: Normal or Partition | Normal |
Column | Name of a column in a table. The column name must contain at least one letter and can contain underscores (_). It cannot contain only digits. You can select Normal or Partition. Partition columns are dedicated to partition tables. User data is partitioned to improve query efficiency. NOTE: The column name is case-insensitive and must be unique. | name |
Type | Data type of a column. This parameter corresponds to Column Name.
| string |
Column Description | Description of a column. | - |
Operation |
| - |
Parameter | Description | Example |
|---|---|---|
Data Format | DLI supports the following data formats:
| CSV |
Storage Path | Enter or select an OBS path. The path can be a file or folder.
| obs://obs1/sampledata.csv |
Table Header: No/Yes | This parameter is valid only when Data Format is set to CSV. Whether the data source to be imported contains the table header. Click Advanced Settings and select the checkbox next to Table Header: No. If the checkbox is selected, the table header is displayed. If the checkbox is deselected, no table header is displayed. | - |
User-defined Delimiter | This parameter is valid only when Data Format is set to CSV and you select User-defined Delimiter. The following delimiters are supported:
| Comma (,) |
User-defined Quotation Character | This parameter is valid only when Data Format is set to CSV and you select User-defined Quotation Character. The following quotation characters are supported:
| Single quotation mark (') |
User-defined Escape Character | This parameter is valid only when Data Format is set to CSV and you select User-defined Escape Character. The following escape characters are supported:
| Backslash (\) |
Date Format | This parameter is valid only when Data Format is set to CSV or JSON. This parameter specifies the format of the date in the table and is valid only Advanced Settings is selected. The default value is yyyy-MM-dd. For definition of characters involved in the date pattern, see Table 3 in . | 2000-01-01 |
Timestamp Format | This parameter is valid only when Data Format is set to CSV or JSON. This parameter specifies the format of the timestamp in the table and is valid only Advanced Settings is selected. The default value is yyyy-MM-dd HH:mm:ss. For definition of characters involved in the time pattern, see Table 3 in . | 2000-01-01 09:00:00 |
After a table is created, you can view and select the table for use on the Data Management page or SQL Editor page.
After a table is created, you can import data from other OBS buckets to the table.
For details about how to import data, see Importing OBS Data to a DLI Table.