<?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 convert  json to csv with optional attributes in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-convert-json-to-csv-with-optional-attributes/m-p/339009#M232995</link>
    <description>&lt;P&gt;I have eventually solved the issue. The Writter property "Schema Access Strategy" was misconfigured. It must be set to "Use 'Schema Text' Property" to really apply the given schema .&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 12:11:36 GMT</pubDate>
    <dc:creator>Jarinek</dc:creator>
    <dc:date>2022-03-21T12:11:36Z</dc:date>
    <item>
      <title>NiFi convert  json to csv with optional attributes</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-convert-json-to-csv-with-optional-attributes/m-p/339005#M232993</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I have a problem with converting json to csv.&lt;/P&gt;
&lt;P&gt;I use ConvertRecord processor with attached JsonTreeReader and CSVRecordSetWriter.&lt;BR /&gt;The schema for both might look like this. Attributes in the json are optional.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
"type": "record",
"name": "some_event",
"fields": [
{ "name": "date_time", "type": ["string","null"] },
{ "name": "id", "type": ["string","null"] },
{ "name": "is_success", "type": ["string","null"] },
{ "name": "username", "type": ["string","null"] },
{ "name": "username_type", "type": ["string","null"] }
]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for the input json like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{
"date_time": "2017-01-29T13:42:03.965Z",
"id": "20049015990001584400001"
"is_success": "TRUE",
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;where username and username_type is not set, the output does not correspond to my expectation&lt;/P&gt;
&lt;P&gt;I get&lt;BR /&gt;2022-01-29T13:42:03.965Z|20049015990001584400001|true&lt;BR /&gt;instead of&lt;BR /&gt;2022-01-29T13:42:03.965Z|20049015990001584400001|true||&lt;BR /&gt;which should be the right format. Note the separator for null values at the end of the second record.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Do you have some hints, how to solve it? It should be sort of standard task.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;CSVRecordSetWriter is configured like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jarinek_0-1647860858204.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/33969iBDE5C2B43D60549C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jarinek_0-1647860858204.png" alt="Jarinek_0-1647860858204.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;We use&lt;/P&gt;
&lt;P&gt;Cloudera Flow Management (CFM) 2.0.4.3&lt;BR /&gt;1.11.4.2.0.4.3-1 built 01/06/2021 23:14:00 CET&lt;/P&gt;
&lt;P&gt;Best regards&lt;BR /&gt;Jaro&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 07:59:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-convert-json-to-csv-with-optional-attributes/m-p/339005#M232993</guid>
      <dc:creator>Jarinek</dc:creator>
      <dc:date>2026-04-21T07:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi convert  json to csv with optional attributes</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-convert-json-to-csv-with-optional-attributes/m-p/339009#M232995</link>
      <description>&lt;P&gt;I have eventually solved the issue. The Writter property "Schema Access Strategy" was misconfigured. It must be set to "Use 'Schema Text' Property" to really apply the given schema .&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 12:11:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-convert-json-to-csv-with-optional-attributes/m-p/339009#M232995</guid>
      <dc:creator>Jarinek</dc:creator>
      <dc:date>2022-03-21T12:11:36Z</dc:date>
    </item>
  </channel>
</rss>

