<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NiFi MergeRecord change number double- int in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375725#M242619</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Problem solved by setting Decimal() type in JoltTransformJSON"stake" processor: ${stake:toDecimal()}&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2023 08:59:37 GMT</pubDate>
    <dc:creator>Dim</dc:creator>
    <dc:date>2023-08-29T08:59:37Z</dc:date>
    <item>
      <title>NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375611#M242543</link>
      <description>&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;Hi all. I can't figure out why the MergeRecord processor converts fractional values ​​to integers. Reading origin from json file.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 15:25:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375611#M242543</guid>
      <dc:creator>Dim</dc:creator>
      <dc:date>2023-08-25T15:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375612#M242544</link>
      <description>&lt;P&gt;Example :&amp;nbsp; &amp;nbsp;"stake" : 0.5 ---&amp;gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;"stake" : 0&amp;nbsp; or 1&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 15:33:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375612#M242544</guid>
      <dc:creator>Dim</dc:creator>
      <dc:date>2023-08-25T15:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375614#M242546</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106687"&gt;@Dim&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103151"&gt;@cotopaul&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 16:25:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375614#M242546</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2023-08-25T16:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375647#M242566</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106687"&gt;@Dim&lt;/a&gt;, I do not think that MergeRecord is the one doing this action, rather the schema you have defined in both your RecordReader and your RecordWriter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working for example with streaming data in Parquet and AVRO Format, using MergeRecord three times during the flow and each fractional remains fractional, because I set the RecordWriter to have a schema which accepts fractional data.&lt;BR /&gt;&lt;BR /&gt;I suggest you to take a look in the schema you have defined within your Controller Services and start debugging from there &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Besides that, your problem might start from a different location. You need to check your flow from start to end and see if you are working with correct scale and precision and if the data types are correct or not.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 07:46:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375647#M242566</guid>
      <dc:creator>cotopaul</dc:creator>
      <dc:date>2023-08-28T07:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375656#M242572</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="222.jpg" style="width: 209px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/38317iB182021E4351A732/image-size/large?v=v2&amp;amp;px=999" role="button" title="222.jpg" alt="222.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="333.jpg" style="width: 996px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/38318i8E1285D6A410097B/image-size/large?v=v2&amp;amp;px=999" role="button" title="333.jpg" alt="333.jpg" /&gt;&lt;/span&gt;Thanks for the hint on the schema. I am using JsonTreeReader and JsonRecordSetWriter as standard. What schema options can be used to make MergeRecord work?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 08:35:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375656#M242572</guid>
      <dc:creator>Dim</dc:creator>
      <dc:date>2023-08-28T08:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375661#M242574</link>
      <description>&lt;P&gt;Well first of all, how does the data look like before entering MergeRecord?&lt;BR /&gt;Secondly, how did you configure both the Reader and the Writer? You pasted the configuration for MergeRecord, where this has nothing to do with how the data gets transformed.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 08:57:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375661#M242574</guid>
      <dc:creator>cotopaul</dc:creator>
      <dc:date>2023-08-28T08:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375666#M242577</link>
      <description>&lt;P&gt;Before&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"UUID_FlowFile" : "0e543142-a8f1-48b4-84b6-b65a85e4708a",&lt;BR /&gt;"update_date" : "2023-08-28 09:26:52",&lt;BR /&gt;"employee_code" : "0000000121",&lt;BR /&gt;"employee_id" : "9bf2cf03-19d4-11ea-8533-00155d0b352f",&lt;BR /&gt;"orgunit_id" : null,&lt;BR /&gt;"stake" : 0.5,&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"UUID_FlowFile" : "0e543142-a8f1-48b4-84b6-b65a85e4708a",&lt;BR /&gt;"update_date" : "2023-08-28 09:26:52",&lt;BR /&gt;"employee_code" : "0000000121",&lt;BR /&gt;"employee_id" : "9bf2cf03-19d4-11ea-8533-00155d0b352f",&lt;BR /&gt;"orgunit_id" : null,&lt;BR /&gt;"stake" : 0,&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reader&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="444.jpg" style="width: 994px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/38319i88D3D4321C7E0B6B/image-size/large?v=v2&amp;amp;px=999" role="button" title="444.jpg" alt="444.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Writer&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="555.jpg" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/38320iCF3B8D1B63DE38A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="555.jpg" alt="555.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 09:42:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375666#M242577</guid>
      <dc:creator>Dim</dc:creator>
      <dc:date>2023-08-28T09:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375669#M242580</link>
      <description>&lt;P&gt;&lt;BR /&gt;I note that there are cases when the union occurs normally. But the dependency is not installed.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 09:52:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375669#M242580</guid>
      <dc:creator>Dim</dc:creator>
      <dc:date>2023-08-28T09:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375675#M242586</link>
      <description>&lt;P&gt;Well I am not near a PC to test right now, but my initial thoughts are that the problem is related to how your raw data is coming in your flow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I can see, you have both an INT value and a FLOAT Value .... and not a constant data type:&lt;/P&gt;&lt;P&gt;"stake" : 0,&lt;/P&gt;&lt;P&gt;"stake" : 0.5,&lt;BR /&gt;&lt;BR /&gt;Now, you set your Schema Access Strategy to Inherit Record Schema.This is correct in most cases, but in your case it is not, because your data is not stable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If two files are going into your MergeRecord and one has the value 0 and one has the value 0,5, you will have two different schemas, meaning that the files cannot be merged accordingly. If the first file comes as an INT, your second flowfile (or all the others coming right after) will automatically be converted to an INT value, no matter their value.&lt;BR /&gt;&lt;BR /&gt;To avoid this, you will have to generate the schema manually and change your RecordReader and your RecordWritter from Inherit Record Schema to "Use Schema Text Property" and define your schema manually in the new field (which will appear upon the switch).&lt;BR /&gt;&lt;BR /&gt;Make sure that in your schema that field is defined with a data type which accepts fractional data and not just an int value.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:05:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375675#M242586</guid>
      <dc:creator>cotopaul</dc:creator>
      <dc:date>2023-08-28T13:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi MergeRecord change number double- int</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375725#M242619</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Problem solved by setting Decimal() type in JoltTransformJSON"stake" processor: ${stake:toDecimal()}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 08:59:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-MergeRecord-change-number-double-int/m-p/375725#M242619</guid>
      <dc:creator>Dim</dc:creator>
      <dc:date>2023-08-29T08:59:37Z</dc:date>
    </item>
  </channel>
</rss>

