Create a table in Azure Data Explorer
Creating a table is an important step in the process of data ingestion and query in Azure Data Explorer. After you've' created a cluster and database in Azure Data Explorer, you can create a table. The following article shows how to create a table and schema mapping quickly and easily using the Azure Data Explorer Web UI.
Prerequisites
- An Azure subscription. Create a free Azure account.
- Create a cluster and database.
- Sign in to the Azure Data Explorer Web UI and add a connection to your cluster.
Note
To enable access between a cluster and a storage account without public access (restricted to private endpoint/service endpoint) in different subnets of the same VNET, see Create a Private Endpoint in your Azure Data Explorer cluster in your virtual network.
Create a table
In the left menu, select Data.
From the Quick actions section, select Create new table. Alternatively, from the All actions section, select Create new table and then Create.
Destination tab
The Create table window opens with the Destination tab selected.
The Cluster and Database fields are prepopulated. You may select different values from the drop-down menu.
In Table name, enter a name for your table.
Tip
Table names can be up to 1024 characters including alphanumeric, hyphens, and underscores. Special characters aren't supported.
Select Next: Source
Source tab
In Source type, select the data source you'll use to create your table mapping. Choose from the following options: From blob, From file, From blob container, From ADLS Gen2 container, and Reference to Event Hub (Preview).
If you're using From blob container:
- Enter the storage url of your blob, and optionally enter the sample size.
- Filter your files using the File Filters.
- Select a file that will be used in the next step to define the schema.
If you're using a local file:
- Select Browse to locate the file, or drag the file into the field.
If you're using a blob:
- In the Link to storage field, add the SAS URL of the container and optionally enter the sample size.
Select Next: Schema to continue to the Schema tab.
Edit Schema
In the Schema tab, your data format and compression are automatically identified in the left-hand pane. If incorrectly identified, use the Data format dropdown menu to select the correct format.
If your data format is JSON, you must also select JSON levels, from 1 to 10. The levels determine the table column data division.
If your data format is CSV, select the check box Ignore the first record to ignore the heading row of the file.
In Mapping, enter a name for this table's schema mapping.
Tip
Table names can include alphanumeric characters and underscores. Spaces, special characters, and hyphens aren't supported.
Select Next: Create table.
Create table completed window
In the Create table completed window, both steps will be marked with green check marks when table creation finishes successfully.
Select View command to open the editor for each step.
- In the editor, you can view and copy the automatic commands generated from your inputs.
In the tiles below the Create table progress, explore Quick queries or Tools:
Quick queries includes links to the Web UI with example queries.
Tools includes links to Undo the table creation by running the relevant
.dropcommands, or Show schema of the newly created table.
Note
You might lose data when you use .drop commands.
The drop commands in this workflow will only revert the changes that were made by the create table process (new table and schema mapping).