You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Alaksiej Ščarbaty (Jira)" <ji...@apache.org> on 2025/06/20 12:54:00 UTC

[jira] [Updated] (NIFI-14675) FIx precision loss in RecordPath number comparisons

     [ https://issues.apache.org/jira/browse/NIFI-14675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alaksiej Ščarbaty updated NIFI-14675:
-------------------------------------
    Description: 
GreaterThanFilter, GreaterThanOrEqualFilter, LessThanFilter, LessThanOrEqualFilter convert incoming numbers to doubles, which introduces errors when comparing long numbers that exceed mantissa capacity for doubles.

Instead, if both numbers are long compatible: i.e. Long, Integer, Short and Byte, they should be compared as longs.

In addition,

When using a long number in a RecordPath, a NumberFormatException occurs.

If the number is quoted, everything works as expected.

  was:
GreaterThanFilter, GreaterThanOrEqualFilter, LessThanFilter, LessThanOrEqualFilter convert incoming numbers to doubles, which introduces errors when comparing long numbers that exceed mantissa capacity for doubles.

Instead, if both numbers are long compatible: i.e. Long, Integer, Short and Byte, they should be compared as longs.


> FIx precision loss in RecordPath number comparisons
> ---------------------------------------------------
>
>                 Key: NIFI-14675
>                 URL: https://issues.apache.org/jira/browse/NIFI-14675
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Alaksiej Ščarbaty
>            Assignee: Alaksiej Ščarbaty
>            Priority: Major
>
> GreaterThanFilter, GreaterThanOrEqualFilter, LessThanFilter, LessThanOrEqualFilter convert incoming numbers to doubles, which introduces errors when comparing long numbers that exceed mantissa capacity for doubles.
> Instead, if both numbers are long compatible: i.e. Long, Integer, Short and Byte, they should be compared as longs.
> In addition,
> When using a long number in a RecordPath, a NumberFormatException occurs.
> If the number is quoted, everything works as expected.



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