Κοινή χρήση μέσω


Explore and create tables in DBFS

Important

This documentation has been retired and might not be updated. The products, services, or technologies mentioned in this content are no longer supported. See Upload files to Azure Databricks, Create or modify a table using file upload, and What is Catalog Explorer?.

Access the legacy DBFS file upload and table creation UI through the add data UI. Click New Icon New > Data > DBFS.

You can also access the UI from notebooks by clicking File > Add data.

Databricks recommends using Catalog Explorer for an improved experience for viewing data objects and managing ACLs and the Create or modify table from file upload page to easily ingest small files into Delta Lake.

Note

Availability of some elements described in this article varies based on workspace configurations. Contact your workspace administrator or Azure Databricks account team.

Import data

If you have small data files on your local machine that you want to analyze with Azure Databricks, you can import them to DBFS using the UI.

Note

Workspace admins can disable this feature. For more information, see Manage data upload.

Create a table

You can launch the DBFS create table UI either by clicking New Icon New in the sidebar or the DBFS button in the add data UI. You can populate a table from files in DBFS or upload files.

With the UI, you can only create external tables.

  1. Choose a data source and follow the steps in the corresponding section to configure the table.

    If an Azure Databricks workspace administrator has disabled the Upload File option, you do not have the option to upload files; you can create tables using one of the other data sources.

    Instructions for Upload File

    1. Drag files to the Files dropzone or click the dropzone to browse and choose files. After upload, a path displays for each file. The path will be something like /FileStore/tables/<filename>-<integer>.<file-type>. You can use this path in a notebook to read data.
    2. Click Create Table with UI.
    3. In the Cluster drop-down, choose a cluster.

    Instructions for DBFS

    1. Select a file.
    2. Click Create Table with UI.
    3. In the Cluster drop-down, choose a cluster.
  2. Click Preview Table to view the table.

  3. In the Table Name field, optionally override the default table name. A table name can contain only lowercase alphanumeric characters and underscores and must start with a lowercase letter or underscore.

  4. In the Create in Database field, optionally override the selected default database.

  5. In the File Type field, optionally override the inferred file type.

  6. If the file type is CSV:

    1. In the Column Delimiter field, select whether to override the inferred delimiter.
    2. Indicate whether to use the first row as the column titles.
    3. Indicate whether to infer the schema.
  7. If the file type is JSON, indicate whether the file is multi-line.

  8. Click Create Table.

View databases and tables

Note

Workspaces with Catalog Explorer enabled do not have access to the legacy behavior described below.

Click Catalog icon Catalog in the sidebar. Azure Databricks selects a running cluster to which you have access. The Databases folder displays the list of databases with the default database selected. The Tables folder displays the list of tables in the default database.

Create tables list

You can change the cluster from the Databases menu, create table UI, or view table UI. For example, from the Databases menu:

  1. Click the Down Caret down arrow at the top of the Databases folder.

  2. Select a cluster.

    Select cluster

View table details

The table details view shows the table schema and sample data.

  1. Click Catalog icon Catalog in the sidebar.

  2. In the Databases folder, click a database.

  3. In the Tables folder, click the table name.

  4. In the Cluster drop-down, optionally select another cluster to render the table preview.

    Table details

    Note

    To display the table preview, a Spark SQL query runs on the cluster selected in the Cluster drop-down. If the cluster already has a workload running on it, the table preview may take longer to load.

Delete a table using the UI

  1. Click Catalog icon Catalog in the sidebar.
  2. Click the Menu Dropdown next to the table name and select Delete.