You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by "Steve Blackmon (JIRA)" <ji...@apache.org> on 2017/07/09 17:36:00 UTC

[jira] [Commented] (STREAMS-519) Support parsing dates with micro and nano precision with StreamsJacksonMapper

    [ https://issues.apache.org/jira/browse/STREAMS-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079674#comment-16079674 ] 

Steve Blackmon commented on STREAMS-519:
----------------------------------------

I think the trick here is to configure sub second precision using joda builder instead of just format strings.

public static final DateTimeFormatter UTC_SUB_SECOND_FMT = new DateTimeFormatterBuilder().appendPattern(BASE_FMT).appendLiteral(".").appendFractionOfSecond(1, 9).toFormatter().withZoneUTC();

Also we've got a legacy RFC3339Utils class that does a lot of heavy lifting but outside the provided framework where a list of formats are provided when getting an instance of StreamsJacksonMapper.  That's problematic because adding global support for a new format requires a code change instead of a config change.

My goal is to deprecate RFC3339Utils as part of this change without changing how StreamsJacksonMapper is used in typical cases.  

> Support parsing dates with micro and nano precision with StreamsJacksonMapper
> -----------------------------------------------------------------------------
>
>                 Key: STREAMS-519
>                 URL: https://issues.apache.org/jira/browse/STREAMS-519
>             Project: Streams
>          Issue Type: Improvement
>            Reporter: Steve Blackmon
>            Assignee: Steve Blackmon
>
> StreamsJacksonMapper does not currently seem to support parsing dates with greater than millisecond precision.  Not surprising as Joda supports millis as its smallest interval, but it should be possible at least to parse a date with greater precision without throwing an exception.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)