herunkang2018 commented on code in PR #225:
URL: https://github.com/apache/calcite-avatica/pull/225#discussion_r1315028983
##########
core/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java:
##########
@@ -61,11 +61,11 @@ private DateTimeUtils() {}
/** Regex for date, YYYY-MM-DD. */
private static final Pattern ISO_DATE_PATTERN =
- Pattern.compile("^(\\d{4})-([0]\\d|1[0-2])-([0-2]\\d|3[01])$");
+ Pattern.compile("^(\\d{4})-([0]?\\d|1[0-2])-([0-2]?\\d|3[01])$");
/** Regex for time, HH:MM:SS. */
private static final Pattern ISO_TIME_PATTERN =
- Pattern.compile("^([0-2]\\d):[0-5]\\d:[0-5]\\d(\\.\\d*)*$");
+ Pattern.compile("^([0-2]\\d):[0-5]?\\d:[0-5]?\\d(\\.\\d*)*$");
Review Comment:
Is `'1:2:5'` also a valid time, with the hour without leading zero? IMO yes,
what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]