diff --git a/rust/lance/src/dataset/scanner.rs b/rust/lance/src/dataset/scanner.rs index 5b030f63bec..760e41ef4e5 100644 --- a/rust/lance/src/dataset/scanner.rs +++ b/rust/lance/src/dataset/scanner.rs @@ -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| { @@ -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| { @@ -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| { @@ -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 @@ -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"# }; @@ -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( @@ -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 { @@ -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"# }; diff --git a/rust/lance/src/io/exec/fts.rs b/rust/lance/src/io/exec/fts.rs index 2ba197da8a0..996d2ffb082 100644 --- a/rust/lance/src/io/exec/fts.rs +++ b/rust/lance/src/io/exec/fts.rs @@ -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 + ) } } } @@ -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 + ) } } } @@ -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 + ) } } }