Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions rust/lance/src/dataset/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7348,7 +7348,7 @@ mod test {
let expected = r#"ProjectionExec: expr=[s@2 as s, _score@1 as _score, _rowid@0 as _rowid]
Take: columns="_rowid, _score, (s)"
CoalesceBatchesExec: target_batch_size=8192
MatchQuery: query=hello"#;
MatchQuery: column=s, query=hello"#;
assert_plan_equals(
&dataset.dataset,
|scan| {
Expand All @@ -7364,7 +7364,7 @@ mod test {
let expected = r#"ProjectionExec: expr=[s@2 as s, _score@1 as _score, _rowid@0 as _rowid]
Take: columns="_rowid, _score, (s)"
CoalesceBatchesExec: target_batch_size=8192
PhraseQuery: query=hello world"#;
PhraseQuery: column=s, query=hello world"#;
assert_plan_equals(
&dataset.dataset,
|scan| {
Expand All @@ -7382,8 +7382,8 @@ mod test {
Take: columns="_rowid, _score, (s)"
CoalesceBatchesExec: target_batch_size=8192
BoostQuery: negative_boost=1
MatchQuery: query=hello
MatchQuery: query=world"#;
MatchQuery: column=s, query=hello
MatchQuery: column=s, query=world"#;
assert_plan_equals(
&dataset.dataset,
|scan| {
Expand All @@ -7405,7 +7405,7 @@ mod test {
r#"ProjectionExec: expr=[s@2 as s, _score@1 as _score, _rowid@0 as _rowid]
Take: columns="_rowid, _score, (s)"
CoalesceBatchesExec: target_batch_size=8192
MatchQuery: query=hello
MatchQuery: column=s, query=hello
RepartitionExec: partitioning=RoundRobinBatch(1), input_partitions=2
UnionExec
MaterializeIndex: query=[i > 10]@i_idx
Expand All @@ -7416,7 +7416,7 @@ mod test {
r#"ProjectionExec: expr=[s@2 as s, _score@1 as _score, _rowid@0 as _rowid]
Take: columns="_rowid, _score, (s)"
CoalesceBatchesExec: target_batch_size=8192
MatchQuery: query=hello
MatchQuery: column=s, query=hello
LanceRead: uri=..., projection=[], num_fragments=5, range_before=None, range_after=None, row_id=true, row_addr=false, full_filter=i > Int32(10), refine_filter=--
ScalarIndexQuery: query=[i > 10]@i_idx"#
};
Expand All @@ -7440,8 +7440,8 @@ mod test {
SortExec: expr=[_score@1 DESC NULLS LAST], preserve_partitioning=[false]
RepartitionExec: partitioning=RoundRobinBatch(1), input_partitions=2
UnionExec
MatchQuery: query=hello
FlatMatchQuery: query=hello
MatchQuery: column=s, query=hello
FlatMatchQuery: column=s, query=hello
LanceScan: uri=..., projection=[s], row_id=true, row_addr=false, ordered=false, range=None"#;
dataset.append_new_data().await?;
assert_plan_equals(
Expand All @@ -7463,14 +7463,14 @@ mod test {
SortExec: expr=[_score@1 DESC NULLS LAST], preserve_partitioning=[false]
RepartitionExec: partitioning=RoundRobinBatch(1), input_partitions=2
UnionExec
MatchQuery: query=hello
MatchQuery: column=s, query=hello
RepartitionExec: partitioning=RoundRobinBatch(1), input_partitions=2
UnionExec
MaterializeIndex: query=[i > 10]@i_idx
ProjectionExec: expr=[_rowid@1 as _rowid]
FilterExec: i@0 > 10
LanceScan: uri=..., projection=[i], row_id=true, row_addr=false, ordered=false, range=None
FlatMatchQuery: query=hello
FlatMatchQuery: column=s, query=hello
FilterExec: i@1 > 10
LanceScan: uri=..., projection=[s, i], row_id=true, row_addr=false, ordered=false, range=None"#
} else {
Expand All @@ -7480,10 +7480,10 @@ mod test {
SortExec: expr=[_score@1 DESC NULLS LAST], preserve_partitioning=[false]
RepartitionExec: partitioning=RoundRobinBatch(1), input_partitions=2
UnionExec
MatchQuery: query=hello
MatchQuery: column=s, query=hello
LanceRead: uri=..., projection=[], num_fragments=5, range_before=None, range_after=None, row_id=true, row_addr=false, full_filter=i > Int32(10), refine_filter=--
ScalarIndexQuery: query=[i > 10]@i_idx
FlatMatchQuery: query=hello
FlatMatchQuery: column=s, query=hello
FilterExec: i@1 > 10
LanceScan: uri=..., projection=[s, i], row_id=true, row_addr=false, ordered=false, range=None"#
};
Expand Down
42 changes: 36 additions & 6 deletions rust/lance/src/io/exec/fts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,20 @@ impl DisplayAs for MatchQueryExec {
fn fmt_as(&self, t: DisplayFormatType, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match t {
DisplayFormatType::Default | DisplayFormatType::Verbose => {
write!(f, "MatchQuery: query={}", self.query.terms)
write!(
f,
"MatchQuery: column={}, query={}",
self.query.column.as_deref().unwrap_or_default(),
self.query.terms
)
}
DisplayFormatType::TreeRender => {
write!(f, "MatchQuery\nquery={}", self.query.terms)
write!(
f,
"MatchQuery\ncolumn={}\nquery={}",
self.query.column.as_deref().unwrap_or_default(),
self.query.terms
)
}
}
}
Expand Down Expand Up @@ -333,10 +343,20 @@ impl DisplayAs for FlatMatchQueryExec {
fn fmt_as(&self, t: DisplayFormatType, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match t {
DisplayFormatType::Default | DisplayFormatType::Verbose => {
write!(f, "FlatMatchQuery: query={}", self.query.terms)
write!(
f,
"FlatMatchQuery: column={}, query={}",
self.query.column.as_deref().unwrap_or_default(),
self.query.terms
)
}
DisplayFormatType::TreeRender => {
write!(f, "FlatMatchQuery\nquery={}", self.query.terms)
write!(
f,
"FlatMatchQuery\ncolumn={}\nquery={}",
self.query.column.as_deref().unwrap_or_default(),
self.query.terms
)
}
}
}
Expand Down Expand Up @@ -491,10 +511,20 @@ impl DisplayAs for PhraseQueryExec {
fn fmt_as(&self, t: DisplayFormatType, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match t {
DisplayFormatType::Default | DisplayFormatType::Verbose => {
write!(f, "PhraseQuery: query={}", self.query.terms)
write!(
f,
"PhraseQuery: column={}, query={}",
self.query.column.as_deref().unwrap_or_default(),
self.query.terms
)
}
DisplayFormatType::TreeRender => {
write!(f, "PhraseQuery\nquery={}", self.query.terms)
write!(
f,
"PhraseQuery\ncolumn={}\nquery={}",
self.query.column.as_deref().unwrap_or_default(),
self.query.terms
)
}
}
}
Expand Down