Skip to content

Make contract clear for KNN nodes#729

Merged
eddyxu merged 12 commits intomainfrom
lei/knn_exec
Mar 24, 2023
Merged

Make contract clear for KNN nodes#729
eddyxu merged 12 commits intomainfrom
lei/knn_exec

Conversation

@eddyxu
Copy link
Copy Markdown
Member

@eddyxu eddyxu commented Mar 24, 2023

Fix KNNFlat / KNNIndex node output schema.
Add preconditions for KNN nodes to check inputs and parameters.
Removed the hack in scanner to pass ann schema explicitly.

@eddyxu eddyxu requested a review from changhiskhan March 24, 2023 04:10
@eddyxu eddyxu requested a review from gsilvestrin March 24, 2023 04:14
@eddyxu eddyxu marked this pull request as ready for review March 24, 2023 04:15
@eddyxu eddyxu self-assigned this Mar 24, 2023
@eddyxu eddyxu added enhancement New feature or request rust Rust related tasks labels Mar 24, 2023
Comment thread .github/workflows/rust.yml Outdated
- name: Run cargo fmt
run: cargo fmt --check
- name: Run clippy
#- name: Run clippy
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

let output_schema = self.scanner_output_schema()?;
Ok(Arc::new(LocalTakeExec::new(
filter_node,
Ok(Arc::new(TakeExec::try_new(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we need a separate LocalTake before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was attempted to make it similar to what C++ does, that it takes the same batch from the input BatchRecords, but later found out it is too difficult to implement that in Rust. In the end, LocalTake becomes almost identical to GlobalTake.

scores,
)?;
let batch_with_score = batch
.try_with_column(ArrowField::new(SCORE_COL, DataType::Float32, false), scores)?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what should the score column's field id be? how would we enforce it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not clear to me why needs to reinforce column id here.

Not clear to me what bug it triggers, as all python tests / rust tests passed. Do you remember which PR # is the fix? i can look into that as well.

@eddyxu eddyxu merged commit 2ff2dd0 into main Mar 24, 2023
@eddyxu eddyxu deleted the lei/knn_exec branch March 24, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rust Rust related tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants