How to keep null xml fields when using Field Flattener?
I'm Using streamset and have a nested XML which I need to parse into a .csv. When I apply the Field Flattener component, it flattens the xml, but it flattens stripping out the field with NULL values. example :
<xml> <a>null</a> <b>
<c>hi</c>
<d>NULL</d> </b> <b>
<c>salut</c>
<d>2</d> </b> </xml>
output wanted in my excel :
|NULL | hi |NULL |
|NULL | salut |2 |
and not
| hi |<br>
| salut | 2 |
Can you export your pipeline to JSON, remove any passwords etc, and add it (or a link to it) to your question?
Sorry, but for GDPR laws I cannot post the json of pipeline even without any password or links etc.etc. in a public site
OK... Use preview to see where the "NULL" string is being converted to a null value. I think that's the problem here.
Checking on preview, the field is listed as d : MAP >0 where it does not show nothing. checking with a Jython Compiler,the length of d field is 0 and is the only way to work on field that has NULL or are empty. I've some field that are null and most that are empty.
With field Flattener component, tag/fields with NULL or Empy value like "" are taken out. I want to keep fields with NULL or empty values, this is my goal. How can I tell streamsets Condition : all fields that you receive which each element has length == 0 then do ?