-
Notifications
You must be signed in to change notification settings - Fork 636
feat: alter the schema registry of table with connector #15025
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
601b24a
reject table with conn in alter source
Rossil2012 6d8e5df
alter table with sr
Rossil2012 1ededfd
Merge branch 'main' into kanzhen/alter-table-sr-with-conn
Rossil2012 e43a7ca
reject when datatype changing
Rossil2012 6e1a471
fix error code
Rossil2012 3603a6f
fix e2e test
Rossil2012 767af6a
add unit test
Rossil2012 2f7b5e8
Merge branch 'main' into kanzhen/alter-table-sr-with-conn
Rossil2012 e967670
more comments
Rossil2012 271d4a3
Update src/frontend/src/handler/alter_table_with_sr.rs
Rossil2012 8f9b6ea
use refresh schema syntax
Rossil2012 7e70968
fix tests
Rossil2012 4ddeb81
fix tests
Rossil2012 fffcd4e
fix tests
Rossil2012 a217e46
Merge branch 'main' into kanzhen/alter-table-sr-with-conn
Rossil2012 ed4712f
wait data propagate
Rossil2012 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 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
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
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
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.
In this case, I guess the user may actually want to refresh the schema i.e. pulling from the schema registry to get a latest schema. Do we have such syntax support?
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.
Yes, that's exactly what this pr has done: impl
ALTER TABLE .. FORMAT .. ENCODE .. (schema.xxx = ...)
.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.
I mean, he might not want to change the
schema.location
ormessage
but only do a refresh from the schema registry (because he has updated the schema in the schema registry server before)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.
Got it. In current impl, users need to repeat the same config as they create the table/source to do a refresh operation. Maybe we can add a shortcut for this purpose:
ALTER ... FORMAT .. ENCODE ..;
: emptyformat_encode_options
implies a simple refresh.ALTER ... REFRESH SCHEMA REGISTRY;
: new syntax to avoid confusion in originalFORMAT ENCODE
syntax.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.
Is there a plan to allow users to specify a completely different set of
FORMAT
andENCODE
when altering a table in the future? If not, I would suggest using a syntax likeALTER ... REFRESH SCHEMA REGISTRY
for clarity and convenience.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.
🤔 I think they can get all the fields easily from the system table.
Both LGTM.
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.
Do we have a decision here?
FYI, we are going to implement
alter source src format xxx encode xxx (connector = 'new_connector')
. As users may have a source for history data and another for incremental data, they can continue the consumption by altering the connector.So we gonna mix
schema refresh
andconnector reset
in the same sql, and probably more cases in the future. The semantic can be confusing then. I suggest we designate the sql individually.Let's start a vote here.
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.
ALTER SOURCE ... REFRESH SCHEMA
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.
ALTER SOURCE ... FORMAT .. ENCODE ..
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.
Actually I believe these two features could be clearly distinguished. 🤔
Refresh schema (or update any other minor configuration fields)
Alter connector
When it comes to designing syntax, I suppose we should choose different syntaxes based on the specific requirements. For example, we may leave the general syntax of
ALTER SOURCE ... FORMAT .. ENCODE ..
for the latter one. For the former feature, a sugar likeREFRESH SCHEMA
looks good to me if we don't find any other similar requirements.