Skip to content

Commit c6ecf1e

Browse files
beinanclaude
andcommitted
refactor: remove Simple executor implementation
Remove the legacy Simple executor to simplify the codebase and reduce maintenance burden. All queries now use the DataFusion planner, which provides better performance and more features. Changes: - Delete simple_executor module (724 lines across 5 files) - Remove ExecutionStrategy::Simple enum variant (breaking change) - Remove CypherQuery::execute_simple() method - Update all tests to use DataFusion execution - Update documentation and examples - Update Python bindings to remove Simple variant Breaking Changes: - Rust: ExecutionStrategy::Simple removed, use None or DataFusion - Python: ExecutionStrategy.Simple removed, use None or DataFusion All existing functionality is preserved - DataFusion supports all features that Simple did with better optimization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 82b98a2 commit c6ecf1e

11 files changed

Lines changed: 16 additions & 1195 deletions

File tree

crates/lance-graph-python/src/graph.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ use crate::RT;
4646
pub enum ExecutionStrategy {
4747
/// Use DataFusion query planner (default, full feature support)
4848
DataFusion,
49-
/// Use simple single-table executor (legacy, limited features)
50-
Simple,
5149
/// Use Lance native executor (not yet implemented)
5250
LanceNative,
5351
}
@@ -56,7 +54,6 @@ impl From<ExecutionStrategy> for RustExecutionStrategy {
5654
fn from(strategy: ExecutionStrategy) -> Self {
5755
match strategy {
5856
ExecutionStrategy::DataFusion => RustExecutionStrategy::DataFusion,
59-
ExecutionStrategy::Simple => RustExecutionStrategy::Simple,
6057
ExecutionStrategy::LanceNative => RustExecutionStrategy::LanceNative,
6158
}
6259
}
@@ -548,7 +545,7 @@ impl CypherQuery {
548545
///
549546
/// >>> # Explicit strategy
550547
/// >>> from lance.graph import ExecutionStrategy
551-
/// >>> result = query.execute(datasets, strategy=ExecutionStrategy.Simple)
548+
/// >>> result = query.execute(datasets, strategy=ExecutionStrategy.DataFusion)
552549
#[pyo3(signature = (datasets, strategy=None))]
553550
fn execute(
554551
&self,

crates/lance-graph/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A graph query engine for Lance datasets with Cypher syntax support. This crate e
77
- Cypher query parsing and AST construction
88
- Graph configuration for mapping Lance tables to nodes and relationships
99
- Semantic validation with typed `GraphError` diagnostics
10-
- Pluggable execution strategies (DataFusion planner by default, simple executor, Lance Native placeholder)
10+
- Pluggable execution strategies (DataFusion planner by default, Lance Native placeholder)
1111
- Async query execution that returns Arrow `RecordBatch` results
1212
- JSON-serializable parameter binding for reusable query templates
1313
- Logical plan debugging via `CypherQuery::explain`
@@ -50,10 +50,7 @@ let query = CypherQuery::new("MATCH (p:Person) WHERE p.age > $min RETURN p.name"
5050

5151
let runtime = tokio::runtime::Runtime::new()?;
5252
// Use default DataFusion-based execution
53-
let result = runtime.block_on(query.execute(tables.clone(), None))?;
54-
55-
// Opt in to the simple executor if you only need projection/filter support.
56-
let simple = runtime.block_on(query.execute(tables, Some(ExecutionStrategy::Simple)))?;
53+
let result = runtime.block_on(query.execute(tables, None))?;
5754
```
5855

5956
The query expects a `HashMap<String, RecordBatch>` keyed by the labels and relationship types referenced in the Cypher text. Each record batch should expose the columns configured through `GraphConfig` (ID fields, property fields, etc.). Relationship mappings also expect a batch keyed by the relationship type (for example `KNOWS`) that contains the configured source/target ID columns and any optional property columns.
@@ -92,10 +89,10 @@ let config = GraphConfig::builder()
9289
- `CypherQuery::new` parses Cypher text into the internal AST.
9390
- `with_config` attaches the graph configuration used for validation and execution.
9491
- `with_parameter` / `with_parameters` bind JSON-serializable values that can be referenced as `$param` in the Cypher text.
95-
- `execute` is asynchronous and returns an Arrow `RecordBatch`. Pass `None` for the default DataFusion planner or `Some(ExecutionStrategy::Simple)` for the single-table executor. `ExecutionStrategy::LanceNative` is reserved for future native execution support and currently errors.
92+
- `execute` is asynchronous and returns an Arrow `RecordBatch`. Pass `None` to use the default DataFusion planner. `ExecutionStrategy::LanceNative` is reserved for future native execution support and currently errors.
9693
- `explain` is asynchronous and returns a formatted string containing the graph logical plan alongside the DataFusion logical and physical plans.
9794

98-
Queries with a single `MATCH` clause containing a path pattern are planned as joins using the provided mappings. Other queries can opt into the single-table projection/filter pipeline via `ExecutionStrategy::Simple` when DataFusion's planner is unnecessary.
95+
All queries use the DataFusion planner for optimization and execution.
9996

10097
A builder (`CypherQueryBuilder`) is also available for constructing queries programmatically without parsing text.
10198

@@ -116,7 +113,6 @@ Basic aggregations like `COUNT` are supported. Optional matches and subqueries a
116113
- `semantic` – Lightweight semantic checks on the AST.
117114
- `logical_plan` – Builders for graph logical plans.
118115
- `datafusion_planner` – DataFusion-based execution planning.
119-
- `simple_executor` – Simple single-table executor.
120116
- `config` – Graph configuration types and builders.
121117
- `query` – High level `CypherQuery` API and runtime.
122118
- `error``GraphError` and result helpers.

crates/lance-graph/benches/graph_execution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fn execute_cypher_query(
7272
datasets: HashMap<String, RecordBatch>,
7373
) -> RecordBatch {
7474
rt.block_on(async move {
75-
q.execute(datasets, Some(ExecutionStrategy::Simple))
75+
q.execute(datasets, None)
7676
.await
7777
.unwrap()
7878
})

crates/lance-graph/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pub mod parameter_substitution;
4747
pub mod parser;
4848
pub mod query;
4949
pub mod semantic;
50-
pub mod simple_executor;
5150
pub mod sql_catalog;
5251
pub mod sql_query;
5352
pub mod table_readers;

0 commit comments

Comments
 (0)