diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 544e85e1..a33bd5a7 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -79,7 +79,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: 'npm' - cache-dependency-path: node/package-lock.json + cache-dependency-path: nodejs/package-lock.json - uses: Swatinem/rust-cache@v2 - name: Install dependencies run: | @@ -137,7 +137,7 @@ jobs: with: node-version: 20 cache: 'npm' - cache-dependency-path: node/package-lock.json + cache-dependency-path: nodejs/package-lock.json - uses: Swatinem/rust-cache@v2 - name: Install dependencies run: | diff --git a/nodejs/examples/ann_indexes.test.ts b/nodejs/examples/ann_indexes.test.ts index a37872c9..138cfb23 100644 --- a/nodejs/examples/ann_indexes.test.ts +++ b/nodejs/examples/ann_indexes.test.ts @@ -12,7 +12,7 @@ test("ann index examples", async () => { // --8<-- [start:ingest] const db = await lancedb.connect(databaseDir); - const data = Array.from({ length: 5_000 }, (_, i) => ({ + const data = Array.from({ length: 1_000 }, (_, i) => ({ vector: Array(128).fill(i), id: `${i}`, content: "", @@ -24,8 +24,8 @@ test("ann index examples", async () => { }); await table.createIndex("vector", { config: lancedb.Index.ivfPq({ - numPartitions: 10, - numSubVectors: 16, + numPartitions: 30, + numSubVectors: 8, }), }); // --8<-- [end:ingest] diff --git a/python/python/lancedb/query.py b/python/python/lancedb/query.py index ab8aee18..4ac0fd6b 100644 --- a/python/python/lancedb/query.py +++ b/python/python/lancedb/query.py @@ -910,7 +910,7 @@ class LanceQueryBuilder(ABC): ProjectionExec: expr=[vector@0 as vector, _distance@2 as _distance] GlobalLimitExec: skip=0, fetch=10 FilterExec: _distance@2 IS NOT NULL - SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST], preserve_partitioning=[false] + SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST, _rowid@1 ASC NULLS LAST], preserve_partitioning=[false] KNNVectorDistance: metric=l2 LanceRead: uri=..., projection=[vector], ... @@ -2041,11 +2041,11 @@ class LanceHybridQueryBuilder(LanceQueryBuilder): >>> plan = table.search(query).explain_plan(True) >>> print(plan) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE ProjectionExec: expr=[vector@0 as vector, _distance@2 as _distance] - GlobalLimitExec: skip=0, fetch=10 - FilterExec: _distance@2 IS NOT NULL - SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST], preserve_partitioning=[false] - KNNVectorDistance: metric=l2 - LanceRead: uri=..., projection=[vector], ... + GlobalLimitExec: skip=0, fetch=10 + FilterExec: _distance@2 IS NOT NULL + SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST, _rowid@1 ASC NULLS LAST], preserve_partitioning=[false] + KNNVectorDistance: metric=l2 + LanceRead: uri=..., projection=[vector], ... Parameters ---------- @@ -2429,7 +2429,7 @@ class AsyncQueryBase(object): ProjectionExec: expr=[vector@0 as vector, _distance@2 as _distance] GlobalLimitExec: skip=0, fetch=10 FilterExec: _distance@2 IS NOT NULL - SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST], preserve_partitioning=[false] + SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST, _rowid@1 ASC NULLS LAST], preserve_partitioning=[false] KNNVectorDistance: metric=l2 LanceRead: uri=..., projection=[vector], ... @@ -3054,7 +3054,7 @@ class AsyncHybridQuery(AsyncQueryBase, AsyncVectorQueryBase): CoalesceBatchesExec: target_batch_size=1024 GlobalLimitExec: skip=0, fetch=10 FilterExec: _distance@2 IS NOT NULL - SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST], preserve_partitioning=[false] + SortExec: TopK(fetch=10), expr=[_distance@2 ASC NULLS LAST, _rowid@1 ASC NULLS LAST], preserve_partitioning=[false] KNNVectorDistance: metric=l2 LanceRead: uri=..., projection=[vector], ... diff --git a/python/python/tests/test_table.py b/python/python/tests/test_table.py index 1e88d794..08dbb242 100644 --- a/python/python/tests/test_table.py +++ b/python/python/tests/test_table.py @@ -290,7 +290,7 @@ def test_add_struct(mem_db: DBConnection): } ) data = [{"s_list": [{"b": 1, "a": 2}, {"b": 4}]}] - table = mem_db.create_table("test", schema=schema) + table = mem_db.create_table("test2", schema=schema) table.add(data)