[
https://issues.apache.org/jira/browse/NIFI-13972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896054#comment-17896054
]
David Handermann commented on NIFI-13972:
-----------------------------------------
For reference, the following simple method runs the string to LocalDateTime
conversion:
{noformat}
public static void main(final String[] args) {
final ObjectLocalDateTimeFieldConverter converter = new
ObjectLocalDateTimeFieldConverter();
final String string = "2020-01-01 12:00:00.123456789";
final Optional<String> pattern = Optional.of("yyyy-MM-dd
HH:mm:ss.SSSSSSSSS");
final long started = System.currentTimeMillis();
final long iterations = 10_000_000L;
for (long i = 0; i < iterations; i++) {
converter.convertField(string, pattern, "fieldName");
}
final long elapsed = System.currentTimeMillis() - started;
System.out.printf("Elapsed: %d ms%n", elapsed);
}
{noformat}
Running that on the current main branch takes around 11000 ms on an Apple M3
Max. Running with a time zone takes around 4500 ms.
Running that with the pull request for NIFI-13978 using the TemporalQuery
approach cuts the above time to around 2500 ms, and around 4000 ms with a time
zone.
> ObjectLocalDateTimeFieldConverter.convertField ignores time zone
> ----------------------------------------------------------------
>
> Key: NIFI-13972
> URL: https://issues.apache.org/jira/browse/NIFI-13972
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Tamas Palfy
> Assignee: Tamas Palfy
> Priority: Major
>
> When the incoming value is a string that contains timezone/offset information
> the returned LocalDateTime simply ignores that part and returns a value as if
> it was in the local timezone.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)