Skip to content

[cdc-common] add PublicEvolving annotation to SchemaUtils.#2756

Merged
PatrickRen merged 2 commits intoapache:masterfrom
lvyanquan0624:schema-util
Nov 28, 2023
Merged

[cdc-common] add PublicEvolving annotation to SchemaUtils.#2756
PatrickRen merged 2 commits intoapache:masterfrom
lvyanquan0624:schema-util

Conversation

@lvyanquan
Copy link
Copy Markdown
Contributor

add PublicEvolving annotation to SchemaUtils, add modify code of SchemaManager to reuse the method of SchemaUtils.

@PatrickRen CC.

@Override
public int hashCode() {
return Objects.hash(columns, primaryKeys, options, comment, nameToColumns);
return Objects.hash(columns, primaryKeys, options, comment);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

remove it because it's initialized lazily.

Copy link
Copy Markdown
Contributor

@PatrickRen PatrickRen left a comment

Choose a reason for hiding this comment

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

@lvyanquan Thanks for the PR! I left some comments.

import java.util.stream.Collectors;

/** Utils for {@link Schema} to perform the ability of evolution. */
@PublicEvolving
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As we are promoting this utility to public, I think we need to be careful about the API, so I have concerns about the method applySchemaChangeEvent with parameter ignoreException. I prefer to remove this one, as I can't see any use cases for ignoring exceptions. Currently there's no usage of it, and the warning log is empty if the exception is ignored, which confuses me a bit.

A better behavior would be clearly defining the exception on the method (throws XXXException) and letting the caller catch and handle it.

@lvyanquan
Copy link
Copy Markdown
Contributor Author

Address it. And XXXException requires unified processing, so just keep to use IllegalArgumentException here.

Copy link
Copy Markdown
Contributor

@PatrickRen PatrickRen left a comment

Choose a reason for hiding this comment

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

@lvyanquan Thanks for the update! LGTM.

@PatrickRen PatrickRen merged commit 3806c72 into apache:master Nov 28, 2023
e-mhui pushed a commit to e-mhui/flink-cdc-connectors that referenced this pull request Dec 2, 2023
ChaomingZhangCN pushed a commit to ChaomingZhangCN/flink-cdc that referenced this pull request Jan 13, 2025
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.

2 participants