Thanks Mark, this is helpful. I found out some more issues. Let me circle back with test data.
Btw, this works with Jackson parser Sent from my iPhone > On Feb 19, 2020, at 3:52 PM, Mark Payne <marka...@hotmail.com> wrote: > > I presume you're using schema inference to determine the column type in the > reader? > > Interestingly, the following code: > System.out.println("As a double: " + Double.parseDouble("999999.99")); > System.out.println("As a float: " + Float.parseFloat("999999.99")); > Produces the following output: > As a double: 999999.99 > As a float: 1000000.0 > > The CSV inference logic has the following code: > if (value.contains(".")) { > try { > final double doubleValue = Double.parseDouble(value); > if (doubleValue > Float.MAX_VALUE || doubleValue < Float.MIN_VALUE) { > return RecordFieldType.DOUBLE.getDataType(); > } > > return RecordFieldType.FLOAT.getDataType(); > } catch (final NumberFormatException nfe) { > return RecordFieldType.STRING.getDataType(); > } > } > > So it determines that there's a decimal point. And the value easily fits > within a Float, so it considers the value to be a Float. We should probably > improve our inference logic to do a better job determining whether a value is > a Float or Double - or else always use a Double instead of a Float. > > Thanks > -Mark > > >> On Feb 19, 2020, at 4:42 PM, Shawn Weeks <swe...@weeksconsulting.us> wrote: >> >> How are you defining the schema and what data type are setting for that >> column? >> >> Thanks >> Shawn >> >> From: KhajaAsmath Mohammed <mdkhajaasm...@gmail.com> >> Reply-To: "users@nifi.apache.org" <users@nifi.apache.org> >> Date: Wednesday, February 19, 2020 at 3:32 PM >> To: "users@nifi.apache.org" <users@nifi.apache.org> >> Subject: NIFI Bug with Convert Record - 999999.99 changed to 1000000.0 >> >> Hi, >> >> I am using below text to convert CSV to JSON using convert record processor. >> Value of 999999.99 changed to 1000000.0 , May I know how is this possible? >> >> >> OPERATING_UNIT|TEST_34_2|TEST_34_15|TEST_34_5 >> "141516"|"1.1"|"1.1"|"1.1" >> "141517"|"1.11"|"1.11"|"1.11" >> "141518"|"1101.11"|"999999.99"|"1101.11" >> >> >> <image001.png> >> >> Is this happening with CSV reader or JSON record set writer? >> >> Thanks, >> Asmath >