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

account for null reference names in validation #1700

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ Feature:File Sink - Verify File Sink Plugin Error scenarios
Then Navigate to the properties page of plugin: "File"
Then Click on the Validate button
Then Verify mandatory property error for below listed properties:
| referenceName |
| path |
| format |
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Feature:File Source - Verify File Source Plugin Error scenarios
Then Navigate to the properties page of plugin: "File"
Then Click on the Validate button
Then Verify mandatory property error for below listed properties:
| referenceName |
| path |
| format |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public abstract class AbstractFileSinkConfig extends PluginConfig implements Fil
public static final String NAME_SUFFIX = "suffix";

@Description("Name be used to uniquely identify this sink for lineage, annotating metadata, etc.")
@Nullable
private String referenceName;

@Macro
Expand Down Expand Up @@ -85,7 +86,9 @@ public void validate(FailureCollector collector) {
}

public void validate(FailureCollector collector, Map<String, String> arguments) {
IdUtils.validateReferenceName(referenceName, collector);
if (!Strings.isNullOrEmpty(referenceName)) {
IdUtils.validateReferenceName(referenceName, collector);
}
if (suffix != null && !containsMacro(NAME_SUFFIX)) {
try {
new SimpleDateFormat(suffix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public abstract class AbstractFileSourceConfig extends PluginConfig implements F
public static final String DEFAULT_FILE_ENCODING = "UTF-8";

@Description("Name be used to uniquely identify this source for lineage, annotating metadata, etc.")
@Nullable
private String referenceName;

@Macro
Expand Down Expand Up @@ -141,7 +142,9 @@ public void validate() {
}

public void validate(FailureCollector collector) {
IdUtils.validateReferenceName(referenceName, collector);
if (!Strings.isNullOrEmpty(referenceName)) {
IdUtils.validateReferenceName(referenceName, collector);
}
try {
getSchema();
} catch (IllegalArgumentException e) {
Expand Down