Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Lance format Lance Java AppendOp

From Leeroopedia


Knowledge Sources
Domains Java_SDK, Dataset_Management
Last Updated 2026-02-08 19:33 GMT

Overview

Description

The Append class is an immutable operation that represents appending new data fragments to an existing Lance dataset. It implements the Operation interface, aligning with the Rust transaction model via JNI. The class uses the builder pattern to construct instances and validates that the provided fragment list is neither null nor empty.

An Append operation records a list of FragmentMetadata objects that describe the new data fragments to be added to the dataset. Each fragment contains metadata about data files, row counts, and physical file locations.

Usage

Use Append when adding new rows to an existing Lance dataset without modifying the schema or existing data. This is the standard write path for incremental ingestion workloads. The operation is submitted as part of a dataset commit transaction.

Code Reference

Source Location

java/src/main/java/org/lance/operation/Append.java

Signature

public class Append implements Operation {
    public static Builder builder();
    public List<FragmentMetadata> fragments();
    public String name();  // returns "Append"
}

Import

import org.lance.operation.Append;

I/O Contract

Inputs
Parameter Type Required Description
fragments List<FragmentMetadata> Yes Non-empty list of fragment metadata describing new data to append
Outputs
Return Type Description
fragments() List<FragmentMetadata> The list of fragment metadata provided at construction
name() String Returns "Append" to identify the operation type for JNI dispatch

Usage Examples

// Build an Append operation with a list of new fragments
List<FragmentMetadata> newFragments = writeNewData(arrowBatches);

Append appendOp = Append.builder()
    .fragments(newFragments)
    .build();

// The operation name is used by the JNI layer to route to the Rust Append handler
String opName = appendOp.name(); // "Append"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment