Implementation:Lance format Lance Java ZoneMapIndexParams
| Knowledge Sources | |
|---|---|
| Domains | Java_SDK, Indexing |
| Last Updated | 2026-02-08 19:33 GMT |
Overview
Description
ZoneMapIndexParams is a final Java class in the org.lance.index.scalar package that provides a builder-style configuration for ZoneMap scalar index parameters. It constructs a ScalarIndexParams instance with the index type set to "zonemap". A zone map index stores min/max statistics per zone (group of rows) to enable fast range-based predicate pushdown. The builder supports a single optional parameter: rowsPerZone, which controls the approximate number of rows in each zone.
Usage
Use ZoneMapIndexParams.builder() to configure zone map index options. The build() method returns a ScalarIndexParams object. The JSON parameters are always serialized (even if empty), using JsonUtils.toJson().
Code Reference
Source Location
java/src/main/java/org/lance/index/scalar/ZoneMapIndexParams.java
Signature
public final class ZoneMapIndexParams {
public static Builder builder();
public static final class Builder {
public Builder rowsPerZone(long rowsPerZone);
public ScalarIndexParams build();
}
}
Import
import org.lance.index.scalar.ZoneMapIndexParams;
I/O Contract
| Parameter | Type | Required | Default | Validation | Description |
|---|---|---|---|---|---|
rowsPerZone |
long |
No | Not set (Rust default) | Must be positive | Approximate number of rows per zone |
| Return Type | Description |
|---|---|
ScalarIndexParams |
A scalar index params object with type "zonemap" and JSON configuration
|
| Key | Type | Description |
|---|---|---|
rows_per_zone |
long |
Approximate number of rows per zone |
Usage Examples
import org.lance.index.scalar.ZoneMapIndexParams;
import org.lance.index.scalar.ScalarIndexParams;
import org.lance.index.IndexParams;
// Create a zone map index with default settings
ScalarIndexParams defaultZoneMap = ZoneMapIndexParams.builder().build();
// Create a zone map index with custom rows per zone
ScalarIndexParams customZoneMap = ZoneMapIndexParams.builder()
.rowsPerZone(8192)
.build();
// Wrap in IndexParams for use with IndexOptions
IndexParams params = IndexParams.builder()
.setScalarIndexParams(customZoneMap)
.build();
Related Pages
- ScalarIndexParams - The output type produced by
ZoneMapIndexParams.Builder.build() - IndexParams - Top-level container that holds scalar index params
- BTreeIndexParams - Another scalar index builder for B-Tree indices
- IndexType - Contains the
ZONEMAPenum constant