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

Change to validateOptionalDatePropery method #3636

Closed
wants to merge 1 commit into from

Conversation

tsriharsha
Copy link

Current version of validateoptionaldateproperty will fail because it will check for date first and if it passes it will fail to get parsed as a double and so it will fail the next step. Please let me know if this is an accurate statement. I just made a small change, may not follow to the pertaining code format though.

Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the How To Contribute guide.
In addition to going through the list, please provide a meaningful description of your changes.

  • General

    • The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
    • The pull request addresses only one issue
    • Each commit in the PR has a meaningful commit message (including the JIRA id)
  • Documentation

    • Documentation has been added for new functionality
    • Old documentation affected by the pull request has been updated
    • JavaDoc for public methods has been added
  • Tests & Build

    • Functionality added by the pull request is covered by tests
    • mvn clean verify has been executed successfully locally or a Travis build has passed

Current version of validateoptionaldateproperty will fail because it will check for date first and if it passes it will fail to get parsed as a double and so it will fail the next step. Please let me know if this is an accurate statement. I just made a small change, may not follow to the pertaining code format though.
@tony810430
Copy link
Contributor

Hi @tsriharsha,

Sorry for missing this PR and pushing my patch #3637.

I have created a JIRA task (FLINK-6211) for it. If you don't mind to update the title and add some tests for this patch, I could close my PR and let you continue working on it.

Thank you.

throw new IllegalArgumentException(message);
}
}
}
public static boolean validateDateFormat(Properties config, String key){
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing empty line before the method declaration

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be private.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it is necessary to have yet another method for this particular case ...
it can be easily written as 2 catch exception branches, which IMO is easier to understand.

@tzulitai
Copy link
Contributor

Hi @tsriharsha!

First of all, thanks a lot for reporting this bug. Contributions in Flink, however, require a corresponding JIRA ticket. In the future, I would recommend always opening a JIRA before the pull request so that other contributors will know that the issue is worked on already (and would therefore avoid race conditions / duplicate work like right now :-D).

Generally, the implementation #3637 is cleaner and includes tests for the fix. I think I'll proceed with FLINK-6211 using the patch in #3637. Hope you understand, and welcome more contributions!

@asfgit asfgit closed this in 69843fe Mar 29, 2017
p16i pushed a commit to p16i/flink that referenced this pull request Apr 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants