Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Currently, if the year that is passed into DateString constructor has five digits, the first digit is trimmed. This trimming happens in the DateTimeStringUtils.int4() method:
private static void int4(StringBuilder buf, int i) { buf.append((char) ('0' + (i / 1000) % 10)); buf.append((char) ('0' + (i / 100) % 10)); buf.append((char) ('0' + (i / 10) % 10)); buf.append((char) ('0' + i % 10)); }
The same problem with month and day values.
Instead of trimming the value, the correct behaviour is to throw an exception if any of the values are outside the expected range.
Attachments
Issue Links
- is related to
-
DRILL-5377 Five-digit year dates are displayed incorrectly via jdbc
- Resolved