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

ASF subversion and git services commented on NIFI-13978:
--------------------------------------------------------

Commit 6bc0e384f40cdbb6e0b1e9155a6907a90d6fd5e1 in nifi's branch 
refs/heads/main from David Handermann
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=6bc0e384f4 ]

NIFI-13978 Improved Performance of Record Date Time Parsing

- Replaced DateTimeFormatter.parseBest() with custom TemporalQuery that checks 
for a ZoneId

This closes #9497.

Signed-off-by: Peter Turcsanyi <[email protected]>


> Improve Performance of Record Date Time Parsing
> -----------------------------------------------
>
>                 Key: NIFI-13978
>                 URL: https://issues.apache.org/jira/browse/NIFI-13978
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: David Handermann
>            Assignee: David Handermann
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Recent changes to handle time zones when parsing strings to LocalDateTime 
> objects for Record processing resulted in sub-optimal performance. 
> Specifically, parsing strings with timestamp patterns that did not include a 
> time zone require two object resolution attempts due to the use of 
> {{DateTimeFormatter.parseBest()}} with {{ZonedDateTime::from}} and then 
> {{LocalDateTime::from}}.
> Instead of relying on multiple passes try-catch handling in {{parseBest()}}, 
> using the standard {{parse()}} method with a custom {{TemporalQuery}} avoids 
> multiple passes. The {{parse()}} method handles parsing a string to a map of 
> fields, and then calls the provided {{TemporalQuery}} to resolve the 
> requested object type. The {{TemporalAccessor}} can be queried for a 
> {{ZoneId}} to determine whether to resolve the object as a {{LocalDateTime}} 
> or a {{ZonedDateTime}} for subsequent conversion to a {{LocalDateTime}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to