You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Mark Payne (Jira)" <ji...@apache.org> on 2020/03/04 16:48:00 UTC

[jira] [Updated] (NIFI-7208) PutSQL doesn't handle nanoseconds

     [ https://issues.apache.org/jira/browse/NIFI-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Payne updated NIFI-7208:
-----------------------------
    Fix Version/s: 1.12.0
       Resolution: Fixed
           Status: Resolved  (was: Patch Available)

> PutSQL doesn't handle nanoseconds
> ---------------------------------
>
>                 Key: NIFI-7208
>                 URL: https://issues.apache.org/jira/browse/NIFI-7208
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>            Reporter: Matt Burgess
>            Assignee: Matt Burgess
>            Priority: Major
>             Fix For: 1.12.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> According to the documentation PutSQL should be able to manage nanoseconds:
> https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.9.0/org.apache.nifi.processors.standard.PutSQL/
> ".]sql.args.N.format [...] as specified according to java.time.format.DateTimeFormatter"
> DateTimeFormatter should be able to manage nanoseconds.
> The issue seems to be happening in JdbcCommon.java
> Line 840-843:
> final DateTimeFormatter dtFormatter = getDateTimeFormatter(valueFormat);
> TemporalAccessor accessor = dtFormatter.parse(parameterValue);
> java.util.Date parsedDate = java.util.Date.from(Instant.from(accessor));
> lTimestamp = parsedDate.getTime();
> It seems to be truncated on line 842
> java.util.Date parsedDate = java.util.Date.from(Instant.from(accessor));
> as java.util.Date doesn't handle nanoseconds. A Java time construct that can handle nanoseconds should be used instead of Date.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)