Skip to content

Commit

Permalink
Categorize exceptions in from_iso_8601 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Jan 9, 2016
1 parent dbc0b9f commit 7e23257
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -195,7 +195,7 @@ public static long fromISO8601Timestamp(ConnectorSession session, @SqlType(Stand
DateTimeFormatter formatter = ISODateTimeFormat.dateTimeParser()
.withChronology(getChronology(session.getTimeZoneKey()))
.withOffsetParsed();
return packDateTimeWithZone(formatter.parseDateTime(iso8601DateTime.toStringUtf8()));
return packDateTimeWithZone(parseDateTimeHelper(formatter, iso8601DateTime.toStringUtf8()));
}

@ScalarFunction("from_iso8601_date")
Expand All @@ -204,7 +204,7 @@ public static long fromISO8601Date(ConnectorSession session, @SqlType(StandardTy
{
DateTimeFormatter formatter = ISODateTimeFormat.dateElementParser()
.withChronology(UTC_CHRONOLOGY);
DateTime dateTime = formatter.parseDateTime(iso8601DateTime.toStringUtf8());
DateTime dateTime = parseDateTimeHelper(formatter, iso8601DateTime.toStringUtf8());
return MILLISECONDS.toDays(dateTime.getMillis());
}

Expand Down

0 comments on commit 7e23257

Please sign in to comment.