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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/guides/loading-data",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Understand options for loading data into Firebolt from your data lake.

# Load data

You can load data into Firebolt from an Amazon S3 bucket using two different workflows.

If you want to get started quickly, load data using a **wizard** in the **Firebolt Workspace**. If you want a more customized experience, you can write **SQL scripts** to handle each part of your workflow. This guide shows you how to load data using both the wizard and SQL, and some common data loading workflows and errors.

<img src="https://mintcdn.com/firebolt/Hc-k8wiP5Rcc9bZ2/assets/images/load_data_workflow.png?fit=max&auto=format&n=Hc-k8wiP5Rcc9bZ2&q=85&s=7e9e0bfd8335a6bbb90fa655b8012312" alt="You can use either the load data wizard or SQL to create a database, engine, and then load data." width="700" data-path="assets/images/load_data_workflow.png" />

<Note>
  Before you can load data, you must first register with Firebolt, then create a database and an engine. For information about how to register, see [Get Started](/guides/getting-started). See the following sections for information about how to create a database and engine.
</Note>

## Load data using a wizard

You can use the **Load data** wizard in the **Firebolt Workspace** to load data in either CSV or Parquet format, and choose from a variety of different loading parameters which include the following:

* Specifying a custom delimiter, quote character, escape character, and other options.
* How to handle errors during data load.
* Specifying a primary index.

The **Load data** wizard guides you through the process of creating an engine and database as part of the loading process.

See [Load data using a wizard](/guides/loading-data/loading-data-wizard) for information about the options available in the **Load data** wizard.

## Load data using SQL

You can use SQL to load data in CSV, Parquet, TSV, AVRO, JSON Lines or ORC formats. Prior to loading data, you must also create a database and engine using either of the following options:

* Use buttons in the **Firebolt Workspace** to create a database and engine. For more information, see the [Create a Database](/guides/getting-started/get-started-sql#create-a-database) and [Create an Engine](/guides/getting-started/get-started-sql#create-an-engine) sections in the [Get Started using SQL](/guides/getting-started/get-started-sql) guide.

* Use the SQL commands [CREATE DATABASE](/reference-sql/commands/data-definition/create-database) and [CREATE ENGINE](/reference-sql/commands/engines/create-engine).

See [SQL to load data](/guides/loading-data/loading-data-sql) for information and code examples to load data using SQL.

## Optimizing during data loading

Optimizing your workflow for Firebolt starts when you load your data. Use the following guidance:

1. A primary index is a sparse index that uniquely identifies rows in a table. Having a primary index is  critical to query performance at Firebolt because it allows a query to locate data without scanning an entire dataset. If you are familiar with your data and query history well enough to select an optimal primary index, you can define it when creating a table. If you don't, you can still load your data without a primary index. Then, once you know your query history patterns, you must create a new table in order to define a primary index.

   You can specify primary indexes in either the **Load data** wizard or inside SQL commands. The [Load data using a wizard](/guides/loading-data/loading-data-wizard) guide discusses considerations for selecting and how to select primary indexes. The [Load data using SQL](/guides/loading-data/loading-data-sql) discusses considerations for selecting and shows code examples that select primary indexes. For more advanced information, see [Primary indexes](/overview/indexes/primary-index).

2. If you intend to use [aggregate functions](/reference-sql/functions-reference/aggregation) in queries, you can calculate an aggregating index when loading your data. Then queries use these pre-calculated values to access information quickly. For an example of calculating an aggregating index during load, see [Load data using SQL](/guides/loading-data/loading-data-sql). For an introduction to aggregating indexes, see the [Aggregating indexes](/guides/getting-started/get-started-sql#aggregating-indexes) section of the **Get Started** guide. For more information, see [Aggregating indexes](/overview/indexes/aggregating-index).

## Next steps

After you load your data, you can start running and optimizing your queries. A typical workflow has the previous steps followed by data and resource cleanup as shown in the following diagram:

<img src="https://mintcdn.com/firebolt/9sNth3Ot9OA4_h_K/assets/images/get_started_workflow.png?fit=max&auto=format&n=9sNth3Ot9OA4_h_K&q=85&s=d06bf34c03d987475a07e6005197ee4b" alt="The load data workflow includes using the load data wizard or SQL to create a database, engine, and then load data." width="700" data-path="assets/images/get_started_workflow.png" />

* [Load data using a wizard](/guides/loading-data/loading-data-wizard)<br />
* [Load data using SQL](/guides/loading-data/loading-data-sql)
