Skip to content

Conversation

@luoyuxia
Copy link
Contributor

No description provided.

@leonardBang leonardBang self-requested a review October 26, 2021 06:54
Comment on lines 61 to 72
public MySqlValidator(Properties dbzProperties) {
this.dbzProperties = dbzProperties;
}

public MySqlValidator(List<String> columns) {
this.columns = columns;
}

public void initDbzProperties(Properties dbzProperties) {
this.dbzProperties = dbzProperties;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Use inner class Builder to build a ``MySqlValidator`

}

/** Validate the schemas from MySQL source contains all columns specified in Flink. */
public void validateSchema(Map<TableId, TableChanges.TableChange> schemas) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We'd better use private method validateSchema(), and we can expose public MySqlSchema getResolvedMysqlSchema() method, the field MySqlSchema mySqlSchema is validated in validateSchema.
In this way, the validator API is more clean.

public SplitEnumerator<MySqlSplit, PendingSplitsState> restoreEnumerator(
SplitEnumeratorContext<MySqlSplit> enumContext, PendingSplitsState checkpoint) {
MySqlSourceConfig sourceConfig = configFactory.createConfig(0);
MySqlValidator validator = new MySqlValidator(sourceConfig.getDbzProperties());
Copy link
Contributor

Choose a reason for hiding this comment

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

we should skip validation if we're restoring from checkpoint

@wuchong wuchong linked an issue Oct 27, 2021 that may be closed by this pull request
@luoyuxia luoyuxia closed this May 31, 2022
@luoyuxia luoyuxia reopened this May 31, 2022
@yuxiqian
Copy link
Member

Hi @luoyuxia, thanks for your contribution! Could you please rebase this PR with latest master branch before we can merge it?

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Jul 17, 2024
@github-actions github-actions bot removed the Stale label Jul 26, 2024
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added Stale and removed Stale labels Sep 24, 2024
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Nov 24, 2024
@github-actions
Copy link

This pull request has been closed because it has not had recent activity. You could reopen it if you try to continue your work, and anyone who are interested in it are encouraged to continue work on this pull request.

@github-actions github-actions bot closed this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[mysql] Add schema validation for table schema

3 participants