-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feat][sql] Support querying compacted data in Pulsar SQL #19515
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
Closed
Conversation
This file contains hidden or 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
|
The pr had no activity for 30 days, mark with Stale label. |
Member
|
I'm going to take a look at this PR. Could you rebase on the latest master? IIRC we make some changes and fix a lot of flaky test so it can ease the review process. |
|
The pr had no activity for 30 days, mark with Stale label. |
Member
|
Closed. We no longer bundle pulsar-sql. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/sql
Pulsar SQL related features
doc-required
Your PR changes impact docs and you will update later.
Stale
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.
Motivation
Currently, the Pulsar SQL doesn't support query compacted data, the compacted data indicates the latest data of one key, it's like the table view of the topic. It's useful to get compacted data through Pulsar SQL, for example, we can get topic policies, etc.
How to use
Use the flag
__compacted_query__to indicate query compacted data or not.Compacted query workflow
About Splits
For the compacted query, one non-partitioned topic or partitioned topic can only have one sub-query task, this is different from the normal query, for a normal query, one topic can split into multi sub-tasks to query.
Modifications
Add a virtual metadata column
__compacted_query__, it indicates execute a compacted query or not.Add a map in
PulsarRecordCusor, it's used to cache the latest message id of the key.Add a
CompactedLedgerReaderinPulsarRecordCusor, it's used to get the latest message id of the key and get complete data by the latest message id.Verifying this change
Add unit test and integration test for the compacted query using Pulsar SQL.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: (gaoran10#22)