Skip to content
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

refactor(meta): rename replace_table to replace_stream_job where appropriate #19537

Merged

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Nov 22, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Although it was only for sink into table/ alter table now, actually in most places, replace_table is as general as replace_stream_job.

I noticed this after renaming TableFragments to StreamJobFragments in #19510.

This can pave way for #18935

Also include some minor style refactoring.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Copy link
Member Author

xxchan commented Nov 22, 2024

@xxchan xxchan changed the title refactor: rename replace_table to replace_stream_job refactor(meta): rename replace_table to replace_stream_job where appropriate Nov 22, 2024
@xxchan xxchan marked this pull request as ready for review November 22, 2024 08:16
#[derive(Debug, Clone)]
pub struct ReplaceTablePlan {
pub struct ReplaceStreamJobPlan {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can see no fields here is strongly related with Table.

Copy link
Member Author

@xxchan xxchan Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the contrary, the proto contains catalog.Table, so it's need more refactoring and cannot be simply renamed.

message ReplaceTablePlan {
// The new table catalog, with the correct (old) table ID and a new version.
// If the new version does not match the subsequent version in the meta service's
// catalog, this request will be rejected.
catalog.Table table = 1;
// The new materialization plan, where all schema are updated.
stream_plan.StreamFragmentGraph fragment_graph = 2;
// The mapping from the old columns to the new columns of the table.
// If no column modifications occur (such as for sinking into table), this will be None.
catalog.ColIndexMapping table_col_index_mapping = 3;
// Source catalog of table's associated source
catalog.Source source = 4;
TableJobType job_type = 5;
}

@xxchan xxchan force-pushed the 11-22-refactor_rename_replace_table_to_replace_stream_job branch 2 times, most recently from 710029a to 792f5e3 Compare November 22, 2024 08:35
@xxchan xxchan force-pushed the 11-22-refactor_rename_replace_table_to_replace_stream_job branch from 792f5e3 to 669ef4f Compare November 25, 2024 07:36
@graphite-app graphite-app bot requested a review from a team November 25, 2024 07:36
Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines +1019 to +1020
match streaming_job {
StreamingJob::Table(_source, table, _table_job_type) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we let .. else { .. } to avoid indent change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add other branch soon...

Signed-off-by: xxchan <[email protected]>
@xxchan xxchan enabled auto-merge November 26, 2024 06:04
@xxchan xxchan added this pull request to the merge queue Nov 26, 2024
Merged via the queue into main with commit 96c5431 Nov 26, 2024
32 of 33 checks passed
@xxchan xxchan deleted the 11-22-refactor_rename_replace_table_to_replace_stream_job branch November 26, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants