Before you import
Before you can import records, 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 the file format required for your index type: Parquet for vector indexes, or JSON Lines (JSONL) for indexes with a document schema. 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 records from a public data source, a storage integration isn’t required. However, to import records 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
- Document schema
- Dense vectors
- Sparse vectors
- Dense + sparse
.jsonl, or gzip-compressed .jsonl.gz) files instead of Parquet. Each line is one document, identical in shape to a document you would pass to documents.upsert: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 .parquet extension for vector indexes, or .jsonl / .jsonl.gz for document-schema indexes:4. Import records into an index
start_import operation to start an asynchronous import of vectors from object storage into an index.
-
For
uri, specify the URI of the bucket and import directory containing the namespaces and Parquet 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 records fail to import. - With
continue, the operation continues on error, but there isn’t any notification about which records, if any, failed to import. To see how many records 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 records to import
- The number of namespaces to import, and the number of records in each
- The total size (in bytes) of the import
describe_import operation with the import ID:
status, percent_complete, and records_imported:
error field with the reason for the failure. See the Troubleshooting section for more information.
Manage imports
List imports
Use thelist_imports operation to list all of the recent and ongoing imports. By default, the operation returns up to 100 imports per page. If the limit 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
Thecancel_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.
- When importing into an index with integrated embedding, records must contain vectors, not text. To add records with text, you must 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
continue and abort error modes:- With
abort: The import fails when it encounters a duplicate vector within the import. - With
continue: The import proceeds, skipping duplicate records silently.
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.