> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Datasets

> Create a table directly from a HuggingFace dataset or an existing Lance dataset in object storage, with one CREATE TABLE AS SELECT.

**Applies to:** Embedded ❌, Enterprise ✅

A `CREATE TABLE ... AS SELECT` (CTAS) reads directly from a HuggingFace
dataset or an existing Lance dataset in object storage, once a
[storage integration](https://docs.lancedb.com/ingestion/define-storage-integration.md) covers that
location -- the integration is never named in the statement, LanceDB
matches it by URI prefix.

## Import a HuggingFace dataset

```sql SQL icon="database" theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
CREATE TABLE imported AS
SELECT * FROM 'hf://datasets/owner/repo/data/train-*.parquet'
```

See [Inspect Datasets](https://docs.lancedb.com/curation/inspect-datasets.md#import) for
the full workflow, including querying a dataset directly without importing
it first.

## Import a Lance dataset from object storage

```sql SQL icon="database" theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
CREATE TABLE events_copy AS
SELECT * FROM 's3://customer-data/raw/events.lance'
```

An `s3://`, `gs://` or `az://` prefix reads an existing **Lance** dataset
the same way as a managed table -- use this to copy a dataset another
process already wrote in Lance format, not an arbitrary file format. See
[Storage Integration](https://docs.lancedb.com/sql/ddl/storage-integration.md#read-import) for GCS and
Azure examples.

## How the import runs

See [Distributed Write](https://docs.lancedb.com/enterprise/distributed-write.md) for how an import's
writes divide across plan executors, and when a small import instead runs
as one local task.

> [!NOTE]
>
> Importing requires a native database with `database_manifest_enabled`.
> Combining a HuggingFace source with a WAL-backed destination table in one
> CTAS is rejected, since the import cannot publish a base-only read that
> omits the destination's unflushed data.

## What to read next

> [card] [Define Storage Integration](https://docs.lancedb.com/ingestion/define-storage-integration.md)
>
> Set up the credential an import reads through.

> [card] [Inspect Datasets](https://docs.lancedb.com/curation/inspect-datasets.md)
>
> Query and import HuggingFace or object-storage datasets in full.

> [card] [Distributed Write](https://docs.lancedb.com/enterprise/distributed-write.md)
>
> How an import's writes divide across plan executors.

> [card] [Storage Integration](https://docs.lancedb.com/sql/ddl/storage-integration.md)
>
> The complete SQL reference for every provider.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.