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

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

  1. In the left menu, select Data.

    Screenshot of the Web UI where you select the Data pane from the menu and then select Create a new table.

  2. 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.

  1. The Cluster and Database fields are prepopulated. You may select different values from the drop-down menu.

  2. 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.

    Screen capture of Destination tab in the Create table window. Cluster, Database, and Table name fields must be filled out before continuing on to Next- Source.

  3. Select Next: Source

Source tab

  1. 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.

      Create table using blob to create schema mapping.

    • If you're using a local file:

      • Select Browse to locate the file, or drag the file into the field.

      Create a table based on data from a local file.

    • 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.
  2. 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.

    Edit schema tab in create table in one-click experience in Azure Data Explorer.

  1. 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.

  2. 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.

    Table creation completed in create a table in one click experience - Azure Data Explorer.

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 .drop commands, 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).

Next steps