You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "David Handermann (Jira)" <ji...@apache.org> on 2024/11/06 17:02:00 UTC
[jira] [Updated] (NIFI-13978) Improve Performance of Record Date Time Parsing
[ https://issues.apache.org/jira/browse/NIFI-13978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Handermann updated NIFI-13978:
------------------------------------
Status: Patch Available (was: Open)
> 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)