[
https://issues.apache.org/jira/browse/NIFI-15973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Handermann resolved NIFI-15973.
-------------------------------------
Fix Version/s: 2.10.0
Resolution: Fixed
> java.sql.Date/Timestamp conversions in record framework apply Julian calendar
> for pre-1582 values
> -------------------------------------------------------------------------------------------------
>
> Key: NIFI-15973
> URL: https://issues.apache.org/jira/browse/NIFI-15973
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Reporter: Kamil Trysiński
> Assignee: Kamil Trysiński
> Priority: Minor
> Fix For: 2.10.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> java.sql.Timestamp#toLocalDateTime,
> java.sql.Timestamp#valueOf(LocalDateTime), java.sql.Date#toLocalDate, and
> java.sql.Date#valueOf(LocalDate) all route through GregorianCalendar, which
> applies Julian-calendar semantics for years before 1582-10-15.
>
> NiFi's record-framework converters and the Avro date logical-type bridge use
> these APIs, so a value whose epoch milliseconds represent year 0001 in the
> proleptic Gregorian calendar (the calendar java.time, Avro, and most
> downstream sinks use) is shifted backward by approximately two days and
> rendered as year 0000. Downstream sinks that validate against an inclusive
> year-1-to-9999 range then reject the row with errors such as "Timestamp out
> of representable inclusive range of years between 1 and 9999, ...
> value:0000-12-30T10:47Z".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)