nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otto Fowler <ottobackwa...@gmail.com>
Subject Re: GetMongo Truncates Dates
Date Tue, 07 Aug 2018 18:21:44 GMT
I commented the jira about that.  We do have validators, or at least the
start of some, but they are in the serialization libraries and would need
to be moved to be usable by both processors and records.


On August 7, 2018 at 13:58:27, Ryan Hendrickson (
ryan.andrew.hendrickson@gmail.com) wrote:

Yea, just finished testing, it works.. I added an additional property
called "Date Format" and I passed in a java date format there.  Now I'm
just wondering if there's a way to validate it's a good date format before
it tries to use it when it's passing docs through.  Maybe a custom
validator?

Ryan

On Tue, Aug 7, 2018 at 1:53 PM Ryan Hendrickson <
ryan.andrew.hendrickson@gmail.com> wrote:

> Haha, yea I'm testing out some code-hacking here to see what I can do
> too.  If it works, I can try to submit a Pull Request for it.  I haven't
> done one before, and this seems pretty easy to make it configurable.
>
> Ryan
>
> On Tue, Aug 7, 2018 at 1:48 PM Mike Thomsen <mikerthomsen@gmail.com>
> wrote:
>
>> Annnndd, I should have read your comment on the Jira ticket because it's
>> even easier than that!
>>
>> On Tue, Aug 7, 2018 at 1:47 PM Mike Thomsen <mikerthomsen@gmail.com>
>> wrote:
>>
>>> I just checked the code, and it's using the default Jackson mapping
>>> behavior for that. The Mongo driver returns a Date, and looks like Jackson
>>> is just turning that into an ISO8601 string without that level of
>>> precision. A custom mapper for Date objects should be able to solve that.
>>> I'll work it when I get some free time from the daily grind.
>>>
>>> Thanks,
>>>
>>> Mike
>>>
>>> On Tue, Aug 7, 2018 at 12:55 PM Ryan Hendrickson <
>>> ryan.andrew.hendrickson@gmail.com> wrote:
>>>
>>>> Hi all,
>>>>    I'm using GetMongo configured with JSON Type of "Standard JSON".
>>>> The document I've got in Mongo has a date field that looks like the
>>>> following:
>>>> {
>>>>    ...
>>>>    "date" : ISODate("2018-08-06T16:20:10.912Z"
>>>>    ...
>>>> }
>>>>
>>>>    When GetMongo spits it out, the date comes out as:
>>>> "2018-08-06T16:20:10Z", noticeably missing the milliseconds.
>>>>
>>>>    I've created a bug ticket here:
>>>> https://issues.apache.org/jira/browse/NIFI-5495.
>>>>
>>>>    I'm not sure if there's a work around or anything like that.  If
>>>> anyone else has suggestions to either add back the missing milliseconds,
>>>> even if it's just tagging on ".000" to get the format back, I'm all ears.
>>>>
>>>> Thanks,
>>>> Ryan
>>>>
>>>

Mime
View raw message