Skip to content

Commit f85787d

Browse files
authored
feat!: create index in v3 version by default (#3477)
BREAKING CHANGE: changed vector index default from `IndexFileVersion::Legacy` to `IndexFileVersion::V3`. To keep the older behavior, you can change `VectorIndexParams::version` in Rust, or _____________ in Python. --------- Signed-off-by: BubbleCal <bubble-cal@outlook.com>
1 parent 0487ff5 commit f85787d

24 files changed

+384
-437
lines changed

Cargo.lock

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+17-17
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exclude = ["python"]
2121
resolver = "2"
2222

2323
[workspace.package]
24-
version = "0.24.2"
24+
version = "0.25.0"
2525
edition = "2021"
2626
authors = ["Lance Devs <dev@lancedb.com>"]
2727
license = "Apache-2.0"
@@ -44,21 +44,21 @@ categories = [
4444
rust-version = "1.81.0"
4545

4646
[workspace.dependencies]
47-
lance = { version = "=0.24.2", path = "./rust/lance" }
48-
lance-arrow = { version = "=0.24.2", path = "./rust/lance-arrow" }
49-
lance-core = { version = "=0.24.2", path = "./rust/lance-core" }
50-
lance-datafusion = { version = "=0.24.2", path = "./rust/lance-datafusion" }
51-
lance-datagen = { version = "=0.24.2", path = "./rust/lance-datagen" }
52-
lance-encoding = { version = "=0.24.2", path = "./rust/lance-encoding" }
53-
lance-encoding-datafusion = { version = "=0.24.2", path = "./rust/lance-encoding-datafusion" }
54-
lance-file = { version = "=0.24.2", path = "./rust/lance-file" }
55-
lance-index = { version = "=0.24.2", path = "./rust/lance-index" }
56-
lance-io = { version = "=0.24.2", path = "./rust/lance-io" }
57-
lance-jni = { version = "=0.24.2", path = "./java/core/lance-jni" }
58-
lance-linalg = { version = "=0.24.2", path = "./rust/lance-linalg" }
59-
lance-table = { version = "=0.24.2", path = "./rust/lance-table" }
60-
lance-test-macros = { version = "=0.24.2", path = "./rust/lance-test-macros" }
61-
lance-testing = { version = "=0.24.2", path = "./rust/lance-testing" }
47+
lance = { version = "=0.25.0", path = "./rust/lance" }
48+
lance-arrow = { version = "=0.25.0", path = "./rust/lance-arrow" }
49+
lance-core = { version = "=0.25.0", path = "./rust/lance-core" }
50+
lance-datafusion = { version = "=0.25.0", path = "./rust/lance-datafusion" }
51+
lance-datagen = { version = "=0.25.0", path = "./rust/lance-datagen" }
52+
lance-encoding = { version = "=0.25.0", path = "./rust/lance-encoding" }
53+
lance-encoding-datafusion = { version = "=0.25.0", path = "./rust/lance-encoding-datafusion" }
54+
lance-file = { version = "=0.25.0", path = "./rust/lance-file" }
55+
lance-index = { version = "=0.25.0", path = "./rust/lance-index" }
56+
lance-io = { version = "=0.25.0", path = "./rust/lance-io" }
57+
lance-jni = { version = "=0.25.0", path = "./java/core/lance-jni" }
58+
lance-linalg = { version = "=0.25.0", path = "./rust/lance-linalg" }
59+
lance-table = { version = "=0.25.0", path = "./rust/lance-table" }
60+
lance-test-macros = { version = "=0.25.0", path = "./rust/lance-test-macros" }
61+
lance-testing = { version = "=0.25.0", path = "./rust/lance-testing" }
6262
approx = "0.5.1"
6363
# Note that this one does not include pyarrow
6464
arrow = { version = "54.1", optional = false, features = ["prettyprint"] }
@@ -117,7 +117,7 @@ datafusion-physical-expr = { version = "45.0" }
117117
deepsize = "0.2.0"
118118
dirs = "5.0.0"
119119
either = "1.0"
120-
fsst = { version = "=0.24.2", path = "./rust/lance-encoding/src/compression_algo/fsst" }
120+
fsst = { version = "=0.25.0", path = "./rust/lance-encoding/src/compression_algo/fsst" }
121121
futures = "0.3"
122122
http = "1.1.0"
123123
hyperloglogplus = { version = "0.4.1", features = ["const-loop"] }

python/Cargo.lock

+13-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pylance"
3-
version = "0.24.2"
3+
version = "0.25.0"
44
edition = "2021"
55
authors = ["Lance Devs <dev@lancedb.com>"]
66
rust-version = "1.65"

python/python/tests/test_vector_index.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def test_pre_populated_ivf_centroids(dataset, tmp_path: Path):
589589
dataset_with_index = dataset.create_index(
590590
["vector"],
591591
index_type="IVF_PQ",
592+
metric="cosine",
592593
ivf_centroids=centroids,
593594
num_partitions=5,
594595
num_sub_vectors=8,
@@ -613,14 +614,15 @@ def test_pre_populated_ivf_centroids(dataset, tmp_path: Path):
613614
"index_type": "IVF_PQ",
614615
"uuid": index_uuid,
615616
"uri": expected_filepath,
616-
"metric_type": "l2",
617+
"metric_type": "cosine",
617618
"num_partitions": 5,
618619
"sub_index": {
619620
"dimension": 128,
620621
"index_type": "PQ",
621622
"metric_type": "l2",
622623
"nbits": 8,
623624
"num_sub_vectors": 8,
625+
"transposed": True,
624626
},
625627
}
626628

rust/lance-index/src/vector.rs

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ lazy_static! {
5656
Field::new(DIST_COL, arrow_schema::DataType::Float32, false),
5757
ROW_ID_FIELD.clone(),
5858
]));
59+
pub static ref PART_ID_FIELD: arrow_schema::Field =
60+
arrow_schema::Field::new(PART_ID_COLUMN, arrow_schema::DataType::UInt32, true);
5961
}
6062

6163
/// Query parameters for the vector indices

0 commit comments

Comments
 (0)