-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: improve v3 indexing perf #3525
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
a1875f5
feat: create index in v3 version by default
BubbleCal 65a7bfd
Merge branch 'main' of https://github.com/lancedb/lance into test-v3-…
BubbleCal cf3a3b8
fix
BubbleCal 2b41880
Merge branch 'main' of https://github.com/lancedb/lance into test-v3-…
BubbleCal 51cd009
fix
BubbleCal f5d137b
fix
BubbleCal 869bfb9
fix
BubbleCal 63efada
fix
BubbleCal e0bd420
fix
BubbleCal c4f0670
fix
BubbleCal c65c3cc
fmt
BubbleCal 90d21a6
fmt
BubbleCal 6c1a284
fix
BubbleCal ac77433
fix
BubbleCal 179f3fa
fmt
BubbleCal 54d7f9e
fmt
BubbleCal 6ddb074
fmt
BubbleCal 5174c1e
fix
BubbleCal 8ea5659
fix
BubbleCal 17c5a66
Merge branch 'main' of https://github.com/lancedb/lance into test-v3-…
BubbleCal 389eea8
fix
BubbleCal f27f920
fix
BubbleCal a99f0f1
remove dup tests
BubbleCal 308663f
Merge branch 'main' of https://github.com/lancedb/lance into test-v3-…
BubbleCal 6340516
perf: improve v3 indexing perf
BubbleCal db9e6d3
Merge branch 'main' of https://github.com/lancedb/lance into improve-…
BubbleCal 8704f1b
add missing file
BubbleCal 0bfc178
remove distance_between
BubbleCal 4bee694
fmt
BubbleCal 54419fb
fix
BubbleCal 86941e5
fix
BubbleCal 8f96ffd
fix
BubbleCal b5e4359
fix
BubbleCal e6677e2
fix
BubbleCal d4a96c1
fmt
BubbleCal f44a492
remove unused param
BubbleCal 0fb6e79
fix
BubbleCal 6241ac3
fmt
BubbleCal 62dbec0
fix
BubbleCal 27ff3a4
fix
BubbleCal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: Copyright The Lance Authors | ||
|
||
use arrow_array::RecordBatch; | ||
use arrow_schema::Field; | ||
use lance_arrow::RecordBatchExt; | ||
use lance_core::Error; | ||
use snafu::location; | ||
use tracing::instrument; | ||
|
||
use crate::vector::transform::Transformer; | ||
|
||
use super::storage::FLAT_COLUMN; | ||
|
||
#[derive(Debug)] | ||
pub struct FlatTransformer { | ||
input_column: String, | ||
} | ||
|
||
impl FlatTransformer { | ||
pub fn new(input_column: impl AsRef<str>) -> Self { | ||
Self { | ||
input_column: input_column.as_ref().to_owned(), | ||
} | ||
} | ||
} | ||
|
||
impl Transformer for FlatTransformer { | ||
#[instrument(name = "FlatTransformer::transform", level = "debug", skip_all)] | ||
fn transform(&self, batch: &RecordBatch) -> crate::Result<RecordBatch> { | ||
let input_arr = batch | ||
.column_by_name(&self.input_column) | ||
.ok_or(Error::Index { | ||
message: format!( | ||
"FlatTransform: column {} not found in batch", | ||
self.input_column | ||
), | ||
location: location!(), | ||
})?; | ||
let field = Field::new( | ||
FLAT_COLUMN, | ||
input_arr.data_type().clone(), | ||
input_arr.is_nullable(), | ||
); | ||
// rename the column to FLAT_COLUMN | ||
let batch = batch | ||
.drop_column(&self.input_column)? | ||
.try_with_column(field, input_arr.clone())?; | ||
Ok(batch) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this transformer do anything else? Or is it just renaming the column?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just renames the column