---
title: "Import Datasets"
sidebarTitle: "Import Datasets"
description: "Create a table directly from a HuggingFace dataset or an existing Lance dataset in object storage, with one CREATE TABLE AS SELECT."
icon: file-import
keywords: ["import", "ctas", "create table as select", "huggingface", "s3", "gcs", "azure"]
availability:
embedded: unavailable
enterprise: available
---
A `CREATE TABLE ... AS SELECT` (CTAS) reads directly from a HuggingFace
dataset or an existing Lance dataset in object storage, once a
[storage integration](/ingestion/define-storage-integration) covers that
location -- the integration is never named in the statement, LanceDB
matches it by URI prefix.
## Import a HuggingFace dataset {#huggingface}
```sql SQL icon="database"
CREATE TABLE imported AS
SELECT * FROM 'hf://datasets/owner/repo/data/train-*.parquet'
```
See [Inspect Datasets](/curation/inspect-datasets#import) for
the full workflow, including querying a dataset directly without importing
it first.
## Import a Lance dataset from object storage {#object-storage}
```sql SQL icon="database"
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](/sql/ddl/storage-integration#read-import) for GCS and
Azure examples.
## How the import runs {#distributed}
See [Distributed Write](/enterprise/distributed-write) for how an import's
writes divide across plan executors, and when a small import instead runs
as one local task.
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 {#next}
Set up the credential an import reads through.
Query and import HuggingFace or object-storage datasets in full.
How an import's writes divide across plan executors.
The complete SQL reference for every provider.