Validating date format in java
What happens if someone provides a five digit year?
You'd throw an exception even though that would be a valid future date.
The while statement verifies the condition before entering into the loop to see whether the next loop iteration should occur or not.
The do-while statement executes the first iteration without checking the condition, it verifies the condition after finishing each iteration.
if you want to check the unit testing for this UDF, please click here.
There are only 4 classes that use Joda-Time, so it should be a quick change, but it would necessitate the switch from JDK 6 to JDK 8. I merged a patch set that fixes that issue over at box-metadata/json-schema-validator and built the resultant jar to group=artifact=json-schema-validator.
However, I am assuming you will only need to use one date format that you used across your company or project.
Tuple; public class Is Date Valid extends Filter Func This UDF could be modified to accept another parameter in case you need to specify the date format on the PIG script.
The do-while statement will always execute the body of a loop at least once.
I'm Nataraja Gootooru, programmer by profession and passionate about technologies.
I'm looking to increase the conciseness of this code.