Before you import
Before you can import data, ensure you have a serverless index, a storage integration, and data uploaded to an Amazon S3 bucket, Google Cloud Storage bucket, or Azure Blob Storage container. Your uploaded data must be in JSON Lines (JSONL) format for a document index, or Parquet for a legacy vector index. If your source data isn’t already in that format, prepare it in that format before uploading.1. Create an index
Create a serverless index for your data. Be sure to create your index on a cloud that supports importing from the object storage you want to use:2. Add a storage integration
To import from a public data source, a storage integration isn’t required. However, to import from a secure data source, you must create an integration to allow Pinecone access to data in your object storage. See the following guides:3. Prepare your data
Create a directory for each namespace
example_namespace1 and example_namespace2, your directory structure would look like this:Create a data file for each namespace
.jsonl, or gzip-compressed .jsonl.gz) files. Each line is one document, identical in shape to a document you would pass to the Upsert documents operation:body field and a dense_vector embedding field:Upload the files
example_namespace1 and example_namespace2 and upload 4 files into each, your directory structure would look as follows after the upload. Files use the .jsonl or .jsonl.gz extension for document indexes, or .parquet for legacy vector indexes:4. Import data into an index
embed or sparse_embed.-
For
uri, specify the URI of the bucket and import directory containing the namespaces and files you want to import. For example:- Amazon S3:
s3://BUCKET_NAME/IMPORT_DIR - Google Cloud Storage:
gs://BUCKET_NAME/IMPORT_DIR - Azure Blob Storage:
https://STORAGE_ACCOUNT.blob.core.windows.net/CONTAINER_NAME/IMPORT_DIR
- Amazon S3:
-
For
integration_id, specify the Integration ID of the Amazon S3, Google Cloud Storage, or Azure Blob Storage integration you created. The ID is found on the Storage integrations page of the Pinecone console.An Integration ID isn’t needed to import from a public bucket. -
For
error_mode, usecontinueorabort.- With
abort, the operation stops if any documents fail to import. - With
continue, the operation continues on error, but there isn’t any notification about which documents, if any, failed to import. To see how many were successfully imported, use the describe an import operation.
- With
id that you can use to check the status of the import:
InProgress, but 100.0 percent complete. Once all the imported records are indexed and fully available for querying, the import operation is set to Completed. If you cancel the import before it finishes, the status changes to Cancelled.
5. Track import progress
The amount of time required for an import depends on various factors, including:- The number of documents to import
- The number of namespaces to import, and the number of documents in each
- The total size (in bytes) of the import
status, percent_complete, and records_imported:
error field with the reason for the failure. See the Troubleshooting section for more information.
Prepare document-schema files (JSONL)
For indexes with a document schema, import files are JSON Lines (.jsonl), optionally gzip-compressed (.jsonl.gz), instead of Parquet. Each line is one document, identical in shape to a document you would pass to the Upsert documents operation, and validated through the same code path, so a document that upserts cleanly imports cleanly.
File format
For example, consider an index whose schema declares one full-text field and one dense vector field:_id, the schema-declared fields, and any additional fields you want stored as filterable metadata (category and year here):
_idis required in every document: a non-empty string, unique within the namespace.- Each document must include at least one schema-declared field; it doesn’t need to populate every declared field.
- Searchable fields declared in the schema are encoded by type:
- A
dense_vectorfield (embeddingabove) is a JSON array of floats whose length equals the schema’s declareddimension. - A
sparse_vectorfield is an object{"indices": [...], "values": [...]}. - A full-text
stringfield (bodyabove) is a JSON string.
- A
- Any other field (
categoryandyearabove) is stored on the document and auto-indexed as filterable metadata: a string, number, boolean, or array of strings. An array of numbers in an undeclared field is rejected rather than stored as metadata. - Field names must not start with
_(reserved for system fields like_id) or$(reserved for filter operators).
Directory layout
Lay files out by namespace, as described in Prepare your data: under a common dataset prefix in your bucket or container, create one subdirectory per namespace and place that namespace’s.jsonl / .jsonl.gz files inside it.
- Each namespace must not already exist in the index — imports only create new namespaces.
- A namespace subdirectory can mix plain
.jsonland gzip-compressed.jsonl.gzfiles.
Prepare a file
Generate a schema-conformant.jsonl (or .jsonl.gz) file from your documents, then upload it to a namespace subdirectory in object storage.
<DATASET_PREFIX>/namespace1/0.jsonl.
Convert Parquet files to JSONL
If your data is already stored as Parquet in the vector import format (id, values, sparse_values, metadata columns), convert each file to JSONL for the document schema. Map id to _id, the vector columns to your schema’s field names, and spread the metadata JSON string into top-level fields:
Manage imports
List imports
Use the List imports operation to list all of the recent and ongoing imports. By default, the operation returns up to 100 imports per page. If thelimit parameter is passed, the operation returns up to that number of imports per page instead. For example, if limit=3, up to 3 imports are returned per page. Whenever there are additional imports to return, the response includes a pagination_token for fetching the next page of imports.
- Python SDK
- Other SDKs
list_import paginates automatically.Cancel an import
The Cancel an import operation cancels an import if it isn’t yet finished. It has no effect if the import is already complete.Import limits
- You can’t import data from an AWS S3 bucket into a Pinecone index hosted on GCP or Azure.
- You can’t import data from S3 Express One Zone storage.
- You can’t import data into an existing namespace.
- When importing data into the
__default__namespace of an index, the default namespace must be empty. - Each import takes at least 10 minutes to complete.
- You can’t import into an index whose schema declares
embedorsparse_embed. To add text that Pinecone embeds, use upsert.
Troubleshooting
When an import fails, you’ll see an error message with the reason for the failure in the Pinecone console or in the response to the describe an import operation.Namespace already exists
Namespace already exists
No namespace found
No namespace found
Parquet files not found
Parquet files not found
Namespace not created (empty subdirectory)
Namespace not created (empty subdirectory)
.jsonl or .jsonl.gz files is silently skipped: the import doesn’t create that namespace and doesn’t raise an error for it. If a namespace is missing after an import that otherwise succeeded, confirm its subdirectory actually contains importable files.If no importable files are found anywhere under the dataset prefix, the import fails with the same No Parquet files found error shown above, which says “Parquet files” even for JSONL imports.Invalid import URI
Invalid import URI
uri must specify only the bucket and import directory containing the namespaces and Parquet files you want to import. If the uri also contains a namespaces directory or a Parquet filename, the import will fail with the following error:uri.Invalid Parquet files
Invalid Parquet files
continue and abort error modes.To fix these errors, check the specific error message and follow the instructions in the Prepare your data section.Invalid JSONL files or documents
Invalid JSONL files or documents
_id:_id entirely fails JSON parsing and appears as a malformed-JSON error (missing field _id).With errorMode.onError set to continue (the default), invalid documents are skipped and the rest import; with abort, the import stops on the first invalid document. If every document in a namespace is skipped, the import fails with No vectors added, all rows were skipped for namespace: {namespace}.To fix these errors, validate your documents against the file-format rules before importing.Invalid records
Invalid records
error_mode is abort and a file contains invalid records, the import will stop processing on the first invalid record and return an error message identifying the file name and row:error_mode is continue, the import will skip individual invalid records. However, if all records are invalid and skipped (for example, the vector type in the file doesn’t match the vector type of the index), the import will fail with a general message:Duplicate records
Duplicate records
2, and one of the two records with ID 1.Import exceeds maximum data size for on-demand
Import exceeds maximum data size for on-demand
.jsonl.gz files, size is measured as an estimated uncompressed size of 10× the compressed file, so gzip-compressed files count roughly 10× their on-disk size against this limit.