Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chebbyChefNEQ committed Jan 26, 2025
1 parent c42aa7b commit ef1ebf0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions rust/lance/src/io/exec/knn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,22 +495,22 @@ impl ExecutionPlan for ANNIvfSubIndexExec {
self: Arc<Self>,
mut children: Vec<Arc<dyn ExecutionPlan>>,
) -> DataFusionResult<Arc<dyn ExecutionPlan>> {
if children.len() != 1 {
let plan = if children.len() == 1 || children.len() == 2 {
// NOTE!!!! Prefilter transformation is ignored.
Self {
input: children.pop().expect("length checked"),
dataset: self.dataset.clone(),
indices: self.indices.clone(),
query: self.query.clone(),
prefilter_source: self.prefilter_source.clone(),
properties: self.properties.clone(),
}
} else {
return Err(DataFusionError::Internal(
"ANNSubIndexExec node must have exactly one child".to_string(),
"ANNSubIndexExec node must have exactly one or two (prefilter) child".to_string(),
));
}

let new_plan = Self {
input: children.pop().expect("length checked"),
dataset: self.dataset.clone(),
indices: self.indices.clone(),
query: self.query.clone(),
prefilter_source: self.prefilter_source.clone(),
properties: self.properties.clone(),
};

Ok(Arc::new(new_plan))
Ok(Arc::new(plan))
}

fn execute(
Expand Down

0 comments on commit ef1ebf0

Please sign in to comment.