Repository navigation
fix(global-index): apply global top-k to full-text search across shards #431
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,11 +31,22 @@ namespace paimon { | |
| /// results. This is used to convert local row IDs into global row IDs. | ||
| class OffsetGlobalIndexReader : public GlobalIndexReader { | ||
| public: | ||
| /// Constructs an OffsetGlobalIndexReader. | ||
| /// Constructs an OffsetGlobalIndexReader whose full-text searches rank all rows it covers. | ||
| /// @param wrapped The inner reader to delegate queries to. Its results are expected to | ||
| /// contain local row ids. | ||
| /// @param offset The offset to add to each row id in the results. | ||
| OffsetGlobalIndexReader(std::shared_ptr<GlobalIndexReader>&& wrapped, int64_t offset); | ||
| /// @param offset The first global row id covered by the wrapped reader, added to each row id | ||
| /// in the results. | ||
| /// @param to The last global row id (inclusive) covered by the wrapped reader. | ||
| OffsetGlobalIndexReader(std::shared_ptr<GlobalIndexReader>&& wrapped, int64_t offset, | ||
| int64_t to); | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like the three-parameter version isn’t used in production code—can we remove it?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked Java’s |
||
| /// Constructs an OffsetGlobalIndexReader whose full-text searches rank rows in [`offset`, | ||
| /// `to`], excluding rows up to `skip_to` (inclusive) assigned to earlier readers. | ||
| /// No row is ranked if `skip_to` >= `to`. Storing the inclusive end avoids computing | ||
| /// INT64_MAX + 1 when an earlier range covers the largest row id. | ||
| /// @param skip_to The last global row id already assigned to an earlier reader. | ||
| OffsetGlobalIndexReader(std::shared_ptr<GlobalIndexReader>&& wrapped, int64_t offset, | ||
| int64_t to, int64_t skip_to); | ||
|
|
||
| Result<std::shared_ptr<GlobalIndexResult>> VisitIsNotNull() override; | ||
| Result<std::shared_ptr<GlobalIndexResult>> VisitIsNull() override; | ||
|
|
@@ -78,6 +89,8 @@ class OffsetGlobalIndexReader : public GlobalIndexReader { | |
| private: | ||
| std::shared_ptr<GlobalIndexReader> wrapped_; | ||
| int64_t offset_; | ||
| int64_t to_; | ||
| int64_t skip_to_; | ||
| }; | ||
|
|
||
| } // namespace paimon | ||
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.
The comment for
OffsetGlobalIndexReaderseems to fully describe full-text search.I think its purpose may be more than just FTS?