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

[FLINK-36514] Fix unable to override exclude schema types in lenient mode #3637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yuxiqian
Copy link
Contributor

This closes FLINK-36514.

If schema evolution behavior is set to LENIENT, Truncate / Drop table events will be ignored by default. However, there's currently no way for users to override this behavior due to the following code:

// YamlPipelineDefinitionParser#toSinkDef
if (excludedSETypes.isEmpty() && SchemaChangeBehavior.LENIENT.equals(schemaChangeBehavior))
{
    // In lenient mode, we exclude DROP_TABLE and TRUNCATE_TABLE by default. This could be
    // overridden by manually specifying excluded types. 
    Stream.of(SchemaChangeEventType.DROP_TABLE, SchemaChangeEventType.TRUNCATE_TABLE) 
        .map(SchemaChangeEventType::getTag)
        .forEach(excludedSETypes::add);
    }
}

If one wants to exclude no types, it's actually not possible since passing [] is equivalent to passing nothing, and DROP and TRUNCATE events will still be ignored.

This could be fixed by checking if exclude.schema.changes has been set, instead of if parsed excludedSETypes set is empty.

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.

1 participant