impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tianyi Wang (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5867: Fix bugs parsing 2-digit year
Date Thu, 31 Aug 2017 01:11:51 GMT
Tianyi Wang has uploaded a new change for review.

Change subject: IMPALA-5867: Fix bugs parsing 2-digit year

IMPALA-5867: Fix bugs parsing 2-digit year

This patch fixes several bugs parsing 1 or 2-digit year formats.
Existing code is broken in several ways:
1. With 1 or 2-digit year format and month/day missing, ParseDateTime()
   throws an uncaught exception.
2. If now() is 02/29 in a leap year but (now() - 80 years) isn't,
   DateTimeFormatContext::SetCenturyBreak() throws an uncaught
3. If the year parsed is 02/29 in a leap year but it isn't a leap year
   100 years ago, TimestampParser::Parse() will consider the date as
   invalid though it isn't.
This patch fixes above bugs and adds a few test cases in
The behaviors after change is:
1. A date without month/day is considered invalid date. Note this is
   different from Hive.
2. Century break would be set to 03/01 80 years ago.
3. If century break is 19XX and parsed date is 00/02/29, always let it
   be 2000/02/29 instead of an invalid date.

Change-Id: Ia4f430caea88b6c33f8050a1984ee0ee32ecb0a1
M be/src/runtime/
M be/src/runtime/
2 files changed, 57 insertions(+), 44 deletions(-)

  git pull ssh:// refs/changes/10/7910/1
To view, visit
To unsubscribe, visit

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4f430caea88b6c33f8050a1984ee0ee32ecb0a1
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tianyi Wang <>

View raw message