lance.LanceFragment.merge_columns(value_func: dict[str, str] | BatchUDF | ReaderLike | collections.abc.Callable[[pa.RecordBatch], pa.RecordBatch], columns: list[str] | None = None, batch_size: int | None = None, reader_schema: pa.Schema | None = None) tuple[FragmentMetadata, LanceSchema]

Add columns to this Fragment.

Warning

Internal API. This method is not intended to be used by end users.

The parameters and their interpretation are the same as in the lance.dataset.LanceDataset.add_columns() operation.

The only difference is that, instead of modifying the dataset, a new fragment is created. The new schema of the fragment is returned as well. These can be used in a later operation to commit the changes to the dataset.

See also

lance.dataset.LanceOperation.Merge

The operation used to commit these changes to the dataset. See the doc page for an example of using this API.

Returns:

A new fragment with the added column(s) and the final schema.

Return type:

Tuple[FragmentMetadata, LanceSchema]