Overview
A common scenario is having column data that already exists in an external dataset — embeddings from a vendor, features exported from a data warehouse, or columnar data in cloud storage — that you want to load into an existing LanceDB table.load_columns joins value columns from an external source into your table by primary key. It works for both use cases:
- Adding new columns: If the specified columns don’t exist in the destination table, they are created automatically.
- Updating existing columns: If the columns already exist, matched rows are updated with the source values. Unmatched rows are controlled by the
on_missingparameter.
External source (Parquet / Lance / IPC):
Destination table (after
load_columns join on pk):
When to use
- Loading new columns: Attach pre-computed embeddings from a vendor, or add features exported from Spark/BigQuery as Parquet.
- Updating existing columns: Replace outdated embeddings with a newer model’s output, or refresh feature values from an updated export.
- Partial updates: Update a subset of rows (e.g., only rows whose embeddings were recomputed) while preserving all other values via carry semantics.
- Format consolidation: Merge columnar data spread across Parquet files into an existing Lance table.
Basic usage
Supports Parquet, Lance, and IPC sources. The format is auto-detected from the URI suffix, or can be overridden withsource_format. You can load one or more columns in a single call.
load_columns_async which returns a JobFuture — call .result() to block until completion.
Handling missing keys
When the source doesn’t cover every row in the destination, theon_missing parameter controls what happens to unmatched rows:
carry mode is particularly important for partial and multi-pass loads — it ensures that previously loaded values are never overwritten.
Performance tuning
Concurrency
Theconcurrency parameter controls the number of worker processes. The default is 8 — set this to match your available cluster resources.
Checkpointing
Bulk load jobs checkpoint each batch for fault tolerance, using the same infrastructure as backfill jobs. Key parameters:checkpoint_interval_seconds: Target seconds per checkpoint batch (default 60s). The adaptive sizer grows or shrinks batch sizes to hit this target.min_checkpoint_size/max_checkpoint_size: Bounds for adaptive sizing.
Commit visibility
For long-running jobs,commit_granularity controls how many fragments complete before an intermediate commit makes partial results visible to readers.
Multi-pass loads for large sources
load_columns builds an in-memory primary-key index from the source. If the source is too large to fit in memory, split it into chunks and run sequential calls. Carry semantics guarantee correctness across passes.
Index memory depends on primary key type:
Choose N so that
source_size / N fits in memory: