> For the complete documentation index, see [llms.txt](https://docs.pinot.apache.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pinot.apache.org/build-with-pinot/ingestion/batch-ingestion.md).

# Batch Ingestion

Batch ingestion builds Pinot segments outside the cluster and pushes them into Pinot after the data is already shaped. Use it when the data changes in larger chunks, when you need deterministic backfills, or when the pipeline already produces files or segment artifacts.

The most important design choice is not the framework, but the output contract: what the schema looks like, what the table expects, and where the segments land.

## Common batch paths

Spark-based ingestion.

Hadoop-style distributed ingestion.

Backfill jobs for historical ranges. Pinot ships `LaunchBackfillIngestionJob` for the case where the backfilled input may have fewer files than the original ingestion — see [Backfill Data](/build-with-pinot/ingestion/batch-ingestion/backfill-data.md).

Dimension tables and other specialized offline loads.

## What to decide early

Decide on the file format, the deep-storage target, and the segment push workflow before you optimize the job itself. Most batch ingestion problems come from mismatched assumptions at those boundaries.

## Select input files

Use `includeFileNamePattern` and `excludeFileNamePattern` in the ingestion job spec to filter input paths. Both accept Java NIO `PathMatcher` patterns with either the `glob:` or `regex:` prefix:

```yaml
includeFileNamePattern: 'glob:**/*.avro'
excludeFileNamePattern: 'regex:.*[.]tmp'
```

The pattern must match the whole normalized path, not only the file name. See [File name patterns](/reference/configuration-reference/job-specification.md#file-name-patterns) for Java regex syntax, job-spec template escaping, and URI normalization details.

## Learn more

The original step-by-step batch docs live in [Import Data](/build-with-pinot/ingestion.md) and [Data Ingestion Overview](/build-with-pinot/ingestion.md).

## What this page covered

This page covered when to choose batch ingestion and the main design decisions that shape it.

## Next step

Read [Stream Ingestion](/build-with-pinot/ingestion/stream-ingestion.md) if the source system is a live event stream.

## Related pages

* [Ingestion](/build-with-pinot/ingestion.md)
* [Stream Ingestion](/build-with-pinot/ingestion/stream-ingestion.md)
* [Formats and Filesystems](/build-with-pinot/ingestion/formats-filesystems.md)
* [Original Batch Docs](/build-with-pinot/ingestion/batch-ingestion/batch-ingestion.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pinot.apache.org/build-with-pinot/ingestion/batch-ingestion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
