Skip to content

v0.3.0

Choose a tag to compare

@prrao87 prrao87 released this 26 Oct 19:25
6095a5e

Note: 0.3.0 was published to crates.io but not to PyPI; its PyPI publish stopped at a flaky test before uploading. Python users should install 0.3.1, which includes everything below plus two fixes.

lance-csr 0.3.0 makes the engine a Rust library, broadens the supported Cypher considerably, and speeds up the GDC Interactive complex reads.

Highlights

  • Use it from Rust. The engine is now on crates.io as lance-csr. lance_csr::CypherEngine is the same CSR-backed engine as the Python class, with an async API, refresh(), statistics and cooperative query deadlines. See Using from Rust.
  • Much more Cypher:
    • UNION / UNION ALL, read-only CALL { ... } subqueries, and named path values with relationships(), startNode() and endNode().
    • keys(), labels(), reduce, and the any / all / none / single predicates.
    • Numeric functions (abs, round, floor, ceil, sqrt) and string and list functions (left, right, substring, replace, split, trim, reverse, last, tail, size, range with a step).
    • List and map parameters, parameters in SKIP / LIMIT, and integer lists that keep their precision.
  • Query timeouts. execute, execute_batches and CypherQuery.execute take a keyword-only timeout= in seconds. Rust callers use lance_csr::query::with_execution_deadline.
  • Faster traversal. The CSR expands high-degree nodes in bounded chunks, traverses variable-length paths iteratively (including zero-hop paths), reuses filter columns, and searches shortest paths from both ends. Repeated queries reuse per-snapshot plan templates.
  • Type stubs. The package ships .pyi stubs and a py.typed marker.
  • target_partitions on CypherEngine (1 to 1024) sets DataFusion's query partitioning.

Performance

Compared with 0.2.0 on the same machine (release builds, both benchmark suites, all result checks passing):

  • GDC Interactive complex reads (IC1–IC14): about 22–25% faster overall. IC12 is about 7× faster and IC13 about 4×.
  • 30-query workload: level overall, but Q30 is about 10–14% slower. IC6 is also about 14% slower in memory. Both are tracked in #56.
  • Engine construction, warm queries and refresh: unchanged.

The published benchmark tables will be refreshed with 0.3.0 in the benchmark repositories.

Behaviour changes

  • The Rust crates are renamed to lance-csr and lance-csr-catalog (use lance_csr::...). The Python package name and import are unchanged.
  • Concurrent refresh() calls run one at a time, so an older snapshot can no longer replace a newer one (#12).
  • Mixing UNION and UNION ALL in one query raises ValueError, as openCypher requires.
  • Type errors in comparisons and arithmetic name the expression and operand types. String-number comparisons such as p.age = '30' still run, as before.
  • Named path records use the metadata fields __lance_csr_properties, __lance_csr_identity, __lance_csr_start and __lance_csr_end.

Known issues

#56 (two slower queries), #58, #59, #60 and #61 (Cypher behaviours that differ from openCypher, with reproductions).

Thanks

Thanks to David Hughes (@stugorf) for the Cypher, CSR and execution work in this release.

Full changelog: v0.2.0...v0.3.0